From: Development-DLA Date: Mon, 17 Jul 2017 14:14:02 +0530 Subject: Merge branch 'develop' of https://openforge.gov.in/plugins/git/digitallocker/development_auth_partner_sm_app --- Merge branch 'develop' of https://openforge.gov.in/plugins/git/digitallocker/development_auth_partner_sm_app --- --- 'a/js/bootstrap.js' +++ b/js/bootstrap.js @@ -3,19 +3,16 @@ * Copyright 2011-2016 Twitter, Inc. * Licensed under the MIT license */ - if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } - +function ($) { 'use strict'; var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { + if ((version[0] < 2 && version[1] < 9) || (version[0] === 1 && version[1] === 9 && version[2] < 1) || (version[0] > 3)) { throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') } }(jQuery); - /* ======================================================================== * Bootstrap: transition.js v3.3.7 * http://getbootstrap.com/javascript/#transitions @@ -23,8 +20,6 @@ if (typeof jQuery === 'undefined') { * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ - - +function ($) { 'use strict'; @@ -212,7 +207,7 @@ if (typeof jQuery === 'undefined') { setTimeout($.proxy(function () { $el[val](data[state] == null ? this.options[state] : data[state]) - if (state == 'loadingText') { + if (state === 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d).prop(d, true) } else if (this.isLoading) { @@ -228,11 +223,11 @@ if (typeof jQuery === 'undefined') { if ($parent.length) { var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { + if ($input.prop('type') === 'radio') { if ($input.prop('checked')) changed = false $parent.find('.active').removeClass('active') this.$element.addClass('active') - } else if ($input.prop('type') == 'checkbox') { + } else if ($input.prop('type') === 'checkbox') { if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false this.$element.toggleClass('active') } @@ -256,7 +251,7 @@ if (typeof jQuery === 'undefined') { if (!data) $this.data('bs.button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() + if (option === 'toggle') data.toggle() else if (option) data.setState(option) }) } @@ -324,7 +319,7 @@ if (typeof jQuery === 'undefined') { this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) - this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + this.options.pause === 'hover' && !('ontouchstart' in document.documentElement) && this.$element .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } @@ -370,10 +365,10 @@ if (typeof jQuery === 'undefined') { Carousel.prototype.getItemForDirection = function (direction, active) { var activeIndex = this.getItemIndex(active) - var willWrap = (direction == 'prev' && activeIndex === 0) - || (direction == 'next' && activeIndex == (this.$items.length - 1)) + var willWrap = (direction === 'prev' && activeIndex === 0) + || (direction === 'next' && activeIndex === (this.$items.length - 1)) if (willWrap && !this.options.wrap) return active - var delta = direction == 'prev' ? -1 : 1 + var delta = direction === 'prev' ? -1 : 1 var itemIndex = (activeIndex + delta) % this.$items.length return this.$items.eq(itemIndex) } @@ -385,7 +380,7 @@ if (typeof jQuery === 'undefined') { if (pos > (this.$items.length - 1) || pos < 0) return if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" - if (activeIndex == pos) return this.pause().cycle() + if (activeIndex === pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } @@ -417,7 +412,7 @@ if (typeof jQuery === 'undefined') { var $active = this.$element.find('.item.active') var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' + var direction = type === 'next' ? 'left' : 'right' var that = this if ($next.hasClass('active')) return (this.sliding = false) @@ -794,7 +789,7 @@ if (typeof jQuery === 'undefined') { if (!$parent.hasClass('open')) return - if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return + if (e && e.type === 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) @@ -854,8 +849,8 @@ if (typeof jQuery === 'undefined') { var $parent = getParent($this) var isActive = $parent.hasClass('open') - if (!isActive && e.which != 27 || isActive && e.which == 27) { - if (e.which == 27) $parent.find(toggle).trigger('focus') + if (!isActive && e.which !== 27 || isActive && e.which === 27) { + if (e.which === 27) $parent.find(toggle).trigger('focus') return $this.trigger('click') } @@ -866,8 +861,8 @@ if (typeof jQuery === 'undefined') { var index = $items.index(e.target) - if (e.which == 38 && index > 0) index-- // up - if (e.which == 40 && index < $items.length - 1) index++ // down + if (e.which === 38 && index > 0) index-- // up + if (e.which === 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items.eq(index).trigger('focus') @@ -1067,7 +1062,7 @@ if (typeof jQuery === 'undefined') { Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { - e.which == 27 && this.hide() + e.which === 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keydown.dismiss.bs.modal') @@ -1115,7 +1110,7 @@ if (typeof jQuery === 'undefined') { return } if (e.target !== e.currentTarget) return - this.options.backdrop == 'static' + this.options.backdrop === 'static' ? this.$element[0].focus() : this.hide() }, this)) @@ -1319,11 +1314,11 @@ if (typeof jQuery === 'undefined') { for (var i = triggers.length; i--;) { var trigger = triggers[i] - if (trigger == 'click') { + if (trigger === 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) - } else if (trigger != 'manual') { - var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' - var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' + } else if (trigger !== 'manual') { + var eventIn = trigger === 'hover' ? 'mouseenter' : 'focusin' + var eventOut = trigger === 'hover' ? 'mouseleave' : 'focusout' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) @@ -1357,7 +1352,7 @@ if (typeof jQuery === 'undefined') { var defaults = this.getDefaults() this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value + if (defaults[key] !== value) options[key] = value }) return options @@ -1373,10 +1368,10 @@ if (typeof jQuery === 'undefined') { } if (obj instanceof $.Event) { - self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true + self.inState[obj.type === 'focusin' ? 'focus' : 'hover'] = true } - if (self.tip().hasClass('in') || self.hoverState == 'in') { + if (self.tip().hasClass('in') || self.hoverState === 'in') { self.hoverState = 'in' return } @@ -1388,7 +1383,7 @@ if (typeof jQuery === 'undefined') { if (!self.options.delay || !self.options.delay.show) return self.show() self.timeout = setTimeout(function () { - if (self.hoverState == 'in') self.show() + if (self.hoverState === 'in') self.show() }, self.options.delay.show) } @@ -1410,7 +1405,7 @@ if (typeof jQuery === 'undefined') { } if (obj instanceof $.Event) { - self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false + self.inState[obj.type === 'focusout' ? 'focus' : 'hover'] = false } if (self.isInStateTrue()) return @@ -1422,7 +1417,7 @@ if (typeof jQuery === 'undefined') { if (!self.options.delay || !self.options.delay.hide) return self.hide() self.timeout = setTimeout(function () { - if (self.hoverState == 'out') self.hide() + if (self.hoverState === 'out') self.hide() }, self.options.delay.hide) } @@ -1471,10 +1466,10 @@ if (typeof jQuery === 'undefined') { var orgPlacement = placement var viewportDim = this.getPosition(this.$viewport) - placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : - placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : - placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : - placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : + placement = placement === 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : + placement === 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : + placement === 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : + placement === 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement $tip @@ -1491,7 +1486,7 @@ if (typeof jQuery === 'undefined') { that.$element.trigger('shown.bs.' + that.type) that.hoverState = null - if (prevHoverState == 'out') that.leave(that) + if (prevHoverState === 'out') that.leave(that) } $.support.transition && this.$tip.hasClass('fade') ? @@ -1535,7 +1530,7 @@ if (typeof jQuery === 'undefined') { var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight - if (placement == 'top' && actualHeight != height) { + if (placement === 'top' && actualHeight != height) { offset.top = offset.top + height - actualHeight } @@ -1572,7 +1567,7 @@ if (typeof jQuery === 'undefined') { var e = $.Event('hide.bs.' + this.type) function complete() { - if (that.hoverState != 'in') $tip.detach() + if (that.hoverState !== 'in') $tip.detach() if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. that.$element .removeAttr('aria-describedby') @@ -1613,7 +1608,7 @@ if (typeof jQuery === 'undefined') { $element = $element || this.$element var el = $element[0] - var isBody = el.tagName == 'BODY' + var isBody = el.tagName === 'BODY' var elRect = el.getBoundingClientRect() if (elRect.width == null) { @@ -1631,9 +1626,9 @@ if (typeof jQuery === 'undefined') { } Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { - return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + return placement === 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement === 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement === 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } } @@ -1686,7 +1681,7 @@ if (typeof jQuery === 'undefined') { Tooltip.prototype.tip = function () { if (!this.$tip) { this.$tip = $(this.options.template) - if (this.$tip.length != 1) { + if (this.$tip.length !== 1) { throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') } } @@ -1966,12 +1961,12 @@ if (typeof jQuery === 'undefined') { var activeTarget = this.activeTarget var i - if (this.scrollHeight != scrollHeight) { + if (this.scrollHeight !== scrollHeight) { this.refresh() } if (scrollTop >= maxScroll) { - return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) + return activeTarget !== (i = targets[targets.length - 1]) && this.activate(i) } if (activeTarget && scrollTop < offsets[0]) { @@ -1980,7 +1975,7 @@ if (typeof jQuery === 'undefined') { } for (i = offsets.length; i--;) { - activeTarget != targets[i] + activeTarget !== targets[i] && scrollTop >= offsets[i] && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) && this.activate(targets[i]) @@ -2257,9 +2252,9 @@ if (typeof jQuery === 'undefined') { var position = this.$element.offset() var targetHeight = this.$target.height() - if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false + if (offsetTop != null && this.affixed === 'top') return scrollTop < offsetTop ? 'top' : false - if (this.affixed == 'bottom') { + if (this.affixed === 'bottom') { if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' } @@ -2301,7 +2296,7 @@ if (typeof jQuery === 'undefined') { var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) - if (this.affixed != affix) { + if (this.affixed !== affix) { if (this.unpin != null) this.$element.css('top', '') var affixType = 'affix' + (affix ? '-' + affix : '') @@ -2312,7 +2307,7 @@ if (typeof jQuery === 'undefined') { if (e.isDefaultPrevented()) return this.affixed = affix - this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + this.unpin = affix === 'bottom' ? this.getPinnedOffset() : null this.$element .removeClass(Affix.RESET) @@ -2320,7 +2315,7 @@ if (typeof jQuery === 'undefined') { .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') } - if (affix == 'bottom') { + if (affix === 'bottom') { this.$element.offset({ top: scrollHeight - height - offsetBottom }) --- 'a/js/modernizr.js' +++ b/js/modernizr.js @@ -649,7 +649,7 @@ window.Modernizr = (function( window, do tests['inlinesvg'] = function() { var div = document.createElement('div'); div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; + return (div.firstChild && div.firstChild.namespaceURI) === ns.svg; }; // SVG SMIL animation tests['smil'] = function() { @@ -740,7 +740,7 @@ window.Modernizr = (function( window, do } else { // If the upgraded input compontent rejects the :) text, we got a winner - bool = inputElem.value != smile; + bool = inputElem.value !== smile; } } @@ -783,8 +783,6 @@ window.Modernizr = (function( window, do if ( Modernizr[feature] !== undefined ) { // we're going to quit if you're trying to overwrite an existing test // if we were to allow it, we'd do this: - // var re = new RegExp("\\b(no-)?" + feature + "\\b"); - // docElement.className = docElement.className.replace( re, '' ); // but, no rly, stuff 'em. return Modernizr; } @@ -829,7 +827,7 @@ window.Modernizr = (function( window, do a.innerHTML = ''; //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles supportsHtml5Styles = ('hidden' in a); - supportsUnknownElements = a.childNodes.length == 1 || (function() { + supportsUnknownElements = a.childNodes.length === 1 || (function() { // assign a false positive if unable to shiv (document.createElement)('a'); var frag = document.createDocumentFragment(); @@ -1115,18 +1113,14 @@ window.Modernizr = (function( window, do // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: - // - // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); // If you're trying to ascertain which transition end event to bind to, you might do something like... // - // var transEndEventNames = { // 'WebkitTransition' : 'webkitTransitionEnd', // 'MozTransition' : 'transitionend', // 'OTransition' : 'oTransitionEnd', // 'msTransition' : 'MSTransitionEnd', // 'transition' : 'transitionend' // }, - // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; Modernizr.prefixed = function(prop, obj, elem){ if(!obj) { return testPropsAll(prop, 'pfx');