Commit d1fbe200 authored by fat's avatar fat
Browse files

remove closureness from plugins

parent 09fb8056
main cleanup-floating-forms cssvar-function dependabot/npm_and_yarn/stylelint-and-stylelint-config-twbs-bootstrap-15.3.0 extend-snippets feat/data-target floating-always-visible floating-labels-icons fod-main-banner form-controls-with-icons github/fork/719media/patch-13 github/fork/719media/patch-14 github/fork/719media/patch-9 github/fork/ChellyAhmed/fix-typo-reboot.md github/fork/ChellyAhmed/offcanvas-scroll-back github/fork/CtrlAltLilith/main github/fork/Elysiome/offcanvas-optional-window-resizing github/fork/JanSargsyan/main github/fork/LunicLynx/support-different-line-height-for-buttons github/fork/Psixodelik/main github/fork/Ronid1/ronid1/offcanvas_static_backdrop github/fork/RyanBerliner/tooltip-accessibility github/fork/SantiagoPVazquez/Feature-default-border-bottom-to-dropdown-item github/fork/Sir-Genius/utils github/fork/Sumit-Singh-8/main github/fork/Viktor-VERA2020/offcanvas-slide github/fork/Zivangu9/input-group-for-form-control-plaintext github/fork/alpadev/alpadev/call-dispose-on-component-reinstantiation github/fork/astagi/fix/tree-shake-modules github/fork/compnerd/dark-accordion-icon github/fork/derSascha/dropdown-dont-close-on-input-click github/fork/dev-ph1l/main github/fork/donquixote/issue-33861-utl-mixin github/fork/florianlacreuse/mixin-make-row-gutter-y github/fork/gregorw/main github/fork/iteggmbh/transitionend-dispose-race github/fork/jdelStrother/patch-1 github/fork/jonnysp/form-floating github/fork/jonnysp/independent-offcanvas github/fork/jonnysp/theme-dark-on-card-and-modal-fix github/fork/josefdlange/floating-label-placeholder-opacity github/fork/julien-deramond/enhance-change-version.js github/fork/julien-deramond/main-jd-fix-offset-content github/fork/julien-deramond/main-jd-issue-with-utitlies github/fork/julien-deramond/main-xmr-pa11y-ci-jd-add-hideElements github/fork/kyletsang/fix-tooltip-padding github/fork/lacutah/CheckboxCenteringDocumentation github/fork/lekoala/patch-3 github/fork/louismaximepiton/main-kld-lmp-collapse-proposal github/fork/louismaximepiton/main-lmp-card-inner-border-radius-fix github/fork/louismaximepiton/main-lmp-carousel-multiple-images github/fork/louismaximepiton/main-lmp-css-var-init github/fork/louismaximepiton/main-lmp-disabled-floating-label-fix github/fork/louismaximepiton/main-lmp-input-range-fix github/fork/louismaximepiton/main-lmp-shift-color github/fork/louismaximepiton/main-lmp-table-active-tr-fix github/fork/maciek-szn/switch github/fork/michael-roth/feature/19964-multiple-tab-targets github/fork/mistic100/dom-utils github/fork/nkdas91/accordion github/fork/nstungcom/fix-missing-modal-open-class github/fork/oraliahdz/animation-utilities github/fork/pine3ree/patch-7 github/fork/pouwerkerk/unindent-scss-docs-shortcode github/fork/smares/smares-no-scolling-on-modal-close github/fork/tgm-git/patch-1 gs-forms gs-toasts-with-animated-progress-bar gs/add-history-helper gs/change-version-dir-on-docs gs/data-must-set-onlu-one-instance gs/docs/fix-drop-down-error gs/event-handler-2 gs/make-docs-js-build gs/make-simple-attribute-toggler gs/popover-fix-doc gs/provide-steConfig-method gs/scrollspy-smoothscroll-option-use-browser-history gs/streamline-jqueryInterface gs/support-drop-down-in-navbar gs/test-js-generic-trigger gs/try-web-components gs/tweak-collapse-js-selector gs/use-event-handler-in-cocmponent gs/use-rollup-replace-for-version jo-docs-thanks-page jo-ssr-friendly logical-props-spacing-utils main-fod-disabled-form-check-label main-fod-nested-accordion main-fod-simpler-table-structure main-fod-table-separator main-fod-utilities-contrast main-jd-abbr-title main-jd-add-chips main-jd-add-doc-for-sass-custom-colors main-jd-add-enable-host-to-handle-web-components main-jd-browserstack-fine-tune main-jd-browserstack-updates main-jd-docs-consistent-usage-of-css-sections-step-2 main-jd-fix-docs-headers-in-white main-jd-fix-highlight-docs-border-radius main-jd-fix-placeholder-color-background-params-for-img-markup main-jd-glossary-experiment main-jd-postcss-drop-empty-css-vars main-jd-proto-doc-astro main-jd-skip-navigation-component main-jd-stackblitz-for-examples main-jd-upgrade-browserlistrc main-jd-use-host main-lmp-dark-theme-customization main-lmp-handle-scroll-target main-lmp-tab-fix main-mc-opensearch main-xmr-bundlewatch-action main-xmr-eslint-plugin-compat main-xmr-hugo-docs-vendor main-xmr-hugo-rm-ver main-xmr-linkinator-prod main-xmr-min-mangle main-xmr-pa11y-ci more-darkmode-examples nested-dropdowns patrickhlauke-issue37428 patrickhlauke-use-of-color-tweaks pr/34102 pr/37590 previous-next-docs-links sticky-thead utilities-functions-mixin v4-dev v4-dev-dropdown-hide-method v530-dev v6-postcss-custom-media v6-spinner-dots v6/gs/use-floating-ui-in-place-of-popper xmr/dev xmr/docs-png xmr/docs-svgs xmr/hugo-reorg-files xmr/js-2 xmr/markdownlint xmr/prepare-530-alpha2 xmr/xo v5.3.0-alpha1 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.2.0-beta1 v5.1.3 v5.1.2 v5.1.1 v5.1.0 v5.0.2 v5.0.1 v5.0.0 v5.0.0-beta3 v5.0.0-beta2 v5.0.0-beta1 v5.0.0-alpha3 v5.0.0-alpha2 v5.0.0-alpha1 v4.6.2 v4.6.1 v4.6.0 v4.5.3 v4.5.2 v4.5.1 v4.5.0 v4.4.1 v4.4.0 v4.3.1 v4.3.0 v4.2.1 v4.2.0 v4.1.3 v4.1.2 v4.1.1 v4.1.0 v4.0.0 v4.0.0-beta.3 v4.0.0-beta.2 v4.0.0-beta v4.0.0-alpha.6 v4.0.0-alpha.5 v4.0.0-alpha.4 v4.0.0-alpha.3 v4.0.0-alpha.2 v4.0.0-alpha
48 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!26437merge,!26197V4 dev xmr,!20778V4 dev,!20539Allow multiple modals,!18047#17986,!18988Blockquote border width,!20854Fixes 15534,!19272V4 dev xmr grunt html,!17218Issue 17066,!19581V4 fix popover,!18283Tether docs fix,!17229Include documentation for .navbar-static-top,!20493V4 dev display,!20636Fix docs for heading sizes,!19824blockquote-center,!22547Finished a new translation for bootstrap,!19534Docs 17264,!19533Npm deps,!22143Fix selectable disabled toggle radio buttons,!19084V4 rhythm,!18085Ie9 click comment,!22598test,!18829Add prefix to carousel classes,!18581Check getting started files for broken links - Issue 18568,!18067replace grunt-autoprefixer with gruntpostcss + autoprefixer,!20099V4.0.0 alpha.3,!20438V4 grid classes,!17307Vertical alignment on Bootstrap columns with equal height,!18477add utility color-contrast function,!18864Feature/navbar toggler support color schemes,!19602V4 palettes arun,!18311V4 dev xmr,!19448New pull request for testing,!19358XXL grid size,!19825.blockquote-center,!17508Fix usage of “its” and “it’s” (v4 docs),!25326Adjust examples,!23995Add back cursor: pointer for .btn-link,!23178Spinner,!19754Issue template,!19753Card img overlay padding,!19747Blockquote border width,!19580ExitStars,!18684Docs: change "Button" to "Go somewhere",!18661Docs: accessibility fix-up of collapsible content navbar, change site-wide main navbar,!17021v4
Showing with 3056 additions and 9086 deletions
+3056 -9086
......@@ -108,80 +108,38 @@ module.exports = function (grunt) {
},
bootstrap: {
src: [
'js/util.js',
'js/transition.js',
'js/alert.js',
'js/button.js',
'js/carousel.js',
'js/collapse.js',
'js/dropdown.js',
'js/modal.js',
'js/scrollspy.js',
'js/tooltip.js',
'js/popover.js',
'js/tab.js'
'js/scrollspy.js',
'js/tab.js',
'js/affix.js'
],
dest: 'dist/js/<%= pkg.name %>.js'
}
},
closureCompiler: {
uglify: {
options: {
compilerFile: require('superstartup-closure-compiler').getPath(),
checkModified: false,
compilerOpts: {
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
// jscomp_warning: 'reportUnknownTypes', someday - maybe we will get to 100% typed, this helps track those down
compilation_level: 'ADVANCED_OPTIMIZATIONS',
warning_level: 'verbose',
summary_detail_level: 3,
output_wrapper:
'"<%= banner %><%= jqueryCheck %><%= jqueryVersionCheck %>'
+ '(function($){%output%})(jQuery);"',
externs: 'js/externs/*.js'
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
compress: {
warnings: false
},
execOpts: {
maxBuffer: 999999 * 1024
},
// [OPTIONAL] Java VM optimization options
// see https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?
// Setting one of these to 'true' is strongly recommended,
// and can reduce compile times by 50-80% depending on compilation size
// and hardware.
// On server-class hardware, such as with Github's Travis hook,
// TieredCompilation should be used; on standard developer hardware,
// d32 may be better. Set as appropriate for your environment.
// Default for both is 'false'; do not set both to 'true'.
d32: false, // will use 'java -client -d32 -jar compiler.jar'
TieredCompilation: false // will use 'java -server -XX:+TieredCompilation -jar compiler.jar'
mangle: true,
preserveComments: 'some'
},
targetName: {
src: [
'js/util.js',
'js/alert.js',
'js/button.js',
'js/carousel.js',
'js/collapse.js',
'js/dropdown.js',
'js/modal.js',
'js/scrollspy.js',
'js/tooltip.js',
'js/popover.js',
'js/tab.js'
],
core: {
src: '<%= concat.bootstrap.dest %>',
dest: 'dist/js/<%= pkg.name %>.min.js'
}
},
uglify: {
options: {
preserveComments: 'some'
},
customize: {
src: configBridge.paths.customizerJs,
dest: 'docs/assets/js/customize.min.js'
},
docsJs: {
src: configBridge.paths.docsJs,
......@@ -443,7 +401,7 @@ module.exports = function (grunt) {
grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']);
// JS distribution task.
grunt.registerTask('dist-js', ['concat', 'closureCompiler', 'commonjs']);
grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']);
grunt.registerTask('test-scss', ['scsslint:scss']);
......
This diff is collapsed.
This diff is collapsed.
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/util.js')
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/scrollspy.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/tab.js')
\ No newline at end of file
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
'use strict';
var fs = require('fs');
var path = require('path');
......
......@@ -17,8 +17,11 @@
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireDollarBeforejQueryAssignment": true,
"requireDotNotation": true,
"requireLineFeedAtFileEnd": true,
"requirePaddingNewLinesAfterUseStrict": true,
"requirePaddingNewLinesBeforeExport": true,
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceAfterLineComment": true,
......@@ -31,7 +34,9 @@
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInsideObjectBrackets": "allButNested",
"validateAlignedFunctionParameters": true,
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateNewlineAfterArrayElements": true,
"validateQuoteMarks": "'"
}
js/affix.js 0 → 100644
/* ========================================================================
* Bootstrap: affix.js v3.3.4
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// AFFIX CLASS DEFINITION
// ======================
var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element = $(element)
this.affixed = null
this.unpin = null
this.pinnedOffset = null
this.checkPosition()
}
Affix.VERSION = '3.3.4'
Affix.RESET = 'affix affix-top affix-bottom'
Affix.DEFAULTS = {
offset: 0,
target: window
}
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
}
var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
return false
}
Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}
Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = Math.max($(document).height(), $(document.body).height())
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}
if (affix == 'bottom') {
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
}
}
// AFFIX PLUGIN DEFINITION
// =======================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.affix
$.fn.affix = Plugin
$.fn.affix.Constructor = Affix
// AFFIX NO CONFLICT
// =================
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
// AFFIX DATA-API
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop
Plugin.call($spy, data)
})
})
}(jQuery);
/** =======================================================================
* Bootstrap: alert.js v4.0.0
/* ========================================================================
* Bootstrap: alert.js v3.3.4
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ========================================================================
* @fileoverview - Bootstrap's generic alert component. Add dismiss
* functionality to all alert messages with this plugin.
*
* Public Methods & Properties:
*
* + $.alert
* + $.alert.noConflict
* + $.alert.Constructor
* + $.alert.Constructor.VERSION
* + $.alert.Constructor.prototype.close
*
* ========================================================================
*/
'use strict';
/**
* Our Alert class.
* @param {Element=} opt_element
* @constructor
*/
var Alert = function (opt_element) {
if (opt_element) {
$(opt_element).on('click', Alert._DISMISS_SELECTOR, Alert._handleDismiss(this))
}
}
/**
* @const
* @type {string}
*/
Alert['VERSION'] = '4.0.0'
/**
* @const
* @type {string}
* @private
*/
Alert._NAME = 'alert'
/**
* @const
* @type {string}
* @private
*/
Alert._DATA_KEY = 'bs.alert'
/**
* @const
* @type {string}
* @private
*/
Alert._DISMISS_SELECTOR = '[data-dismiss="alert"]'
/**
* @const
* @type {number}
* @private
*/
Alert._TRANSITION_DURATION = 150
* ======================================================================== */
/**
* @const
* @type {Function}
* @private
*/
Alert._JQUERY_NO_CONFLICT = $.fn[Alert._NAME]
+function ($) {
'use strict';
/**
* @const
* @enum {string}
* @private
*/
Alert._Event = {
CLOSE : 'close.bs.alert',
CLOSED : 'closed.bs.alert'
}
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
/**
* @const
* @enum {string}
* @private
*/
Alert._ClassName = {
ALERT : 'alert',
FADE : 'fade',
IN : 'in'
}
Alert.VERSION = '3.3.4'
Alert.TRANSITION_DURATION = 150
/**
* Provides the jQuery Interface for the alert component.
* @param {string=} opt_config
* @this {jQuery}
* @return {jQuery}
* @private
*/
Alert._jQueryInterface = function (opt_config) {
return this.each(function () {
var $this = $(this)
var data = $this.data(Alert._DATA_KEY)
Alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!data) {
data = new Alert(this)
$this.data(Alert._DATA_KEY, data)
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
if (opt_config === 'close') {
data[opt_config](this)
}
})
}
var $parent = $(selector)
if (e) e.preventDefault()
/**
* Close the alert component
* @param {Alert} alertInstance
* @return {Function}
* @private
*/
Alert._handleDismiss = function (alertInstance) {
return function (event) {
if (event) {
event.preventDefault()
if (!$parent.length) {
$parent = $this.closest('.alert')
}
alertInstance['close'](this)
}
}
$parent.trigger(e = $.Event('close.bs.alert'))
/**
* Close the alert component
* @param {Element} element
*/
Alert.prototype['close'] = function (element) {
var rootElement = this._getRootElement(element)
var customEvent = this._triggerCloseEvent(rootElement)
if (e.isDefaultPrevented()) return
if (customEvent.isDefaultPrevented()) return
$parent.removeClass('in')
this._removeElement(rootElement)
}
/**
* Tries to get the alert's root element
* @return {Element}
* @private
*/
Alert.prototype._getRootElement = function (element) {
var parent = false
var selector = Bootstrap.getSelectorFromElement(element)
if (selector) {
parent = $(selector)[0]
}
function removeElement() {
// detach from parent, fire event then clean up data
$parent.detach().trigger('closed.bs.alert').remove()
}
if (!parent) {
parent = $(element).closest('.' + Alert._ClassName.ALERT)[0]
$.support.transition && $parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}
return parent
}
/**
* Trigger close event on element
* @return {$.Event}
* @private
*/
Alert.prototype._triggerCloseEvent = function (element) {
var closeEvent = $.Event(Alert._Event.CLOSE)
$(element).trigger(closeEvent)
return closeEvent
}
// ALERT PLUGIN DEFINITION
// =======================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
/**
* Trigger closed event and remove element from dom
* @private
*/
Alert.prototype._removeElement = function (element) {
$(element).removeClass(Alert._ClassName.IN)
if (!Bootstrap.transition || !$(element).hasClass(Alert._ClassName.FADE)) {
this._destroyElement(element)
return
if (!data) $this.data('bs.alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$(element)
.one(Bootstrap.TRANSITION_END, this._destroyElement.bind(this, element))
.emulateTransitionEnd(Alert._TRANSITION_DURATION)
}
var old = $.fn.alert
/**
* clean up any lingering jquery data and kill element
* @private
*/
Alert.prototype._destroyElement = function (element) {
$(element)
.detach()
.trigger(Alert._Event.CLOSED)
.remove()
}
$.fn.alert = Plugin
$.fn.alert.Constructor = Alert
/**
* ------------------------------------------------------------------------
* jQuery Interface + noConflict implementaiton
* ------------------------------------------------------------------------
*/
/**
* @const
* @type {Function}
*/
$.fn[Alert._NAME] = Alert._jQueryInterface
/**
* @const
* @type {Function}
*/
$.fn[Alert._NAME]['Constructor'] = Alert
// ALERT NO CONFLICT
// =================
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
/**
* @return {Function}
*/
$.fn[Alert._NAME]['noConflict'] = function () {
$.fn[Alert._NAME] = Alert._JQUERY_NO_CONFLICT
return Alert._jQueryInterface
}
// ALERT DATA-API
// ==============
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
*/
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
$(document).on('click.bs.alert.data-api', Alert._DISMISS_SELECTOR, Alert._handleDismiss(new Alert))
}(jQuery);
/** =======================================================================
* Bootstrap: button.js v4.0.0
/* ========================================================================
* Bootstrap: button.js v3.3.4
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ========================================================================
* @fileoverview - Bootstrap's generic button component.
*
* Note (@fat): Deprecated "setState" – imo, better solutions for managing a
* buttons state should exist outside this plugin.
*
* Public Methods & Properties:
*
* + $.button
* + $.button.noConflict
* + $.button.Constructor
* + $.button.Constructor.VERSION
* + $.button.Constructor.prototype.toggle
*
* ========================================================================
*/
'use strict';
/**
* Our Button class.
* @param {Element!} element
* @constructor
*/
var Button = function (element) {
/** @private {Element} */
this._element = element
}
/**
* @const
* @type {string}
*/
Button['VERSION'] = '4.0.0'
/**
* @const
* @type {string}
* @private
*/
Button._NAME = 'button'
/**
* @const
* @type {string}
* @private
*/
Button._DATA_KEY = 'bs.button'
/**
* @const
* @type {Function}
* @private
*/
Button._JQUERY_NO_CONFLICT = $.fn[Button._NAME]
/**
* @const
* @enum {string}
* @private
*/
Button._ClassName = {
ACTIVE : 'active',
BUTTON : 'btn',
FOCUS : 'focus'
}
/**
* @const
* @enum {string}
* @private
*/
Button._Selector = {
DATA_TOGGLE_CARROT : '[data-toggle^="button"]',
DATA_TOGGLE : '[data-toggle="buttons"]',
INPUT : 'input',
ACTIVE : '.active',
BUTTON : '.btn'
}
/**
* Provides the jQuery Interface for the Button component.
* @param {string=} opt_config
* @this {jQuery}
* @return {jQuery}
* @private
*/
Button._jQueryInterface = function (opt_config) {
return this.each(function () {
var data = $(this).data(Button._DATA_KEY)
if (!data) {
data = new Button(this)
$(this).data(Button._DATA_KEY, data)
}
* ======================================================================== */
if (opt_config === 'toggle') {
data[opt_config]()
}
})
}
/**
* Toggle's the button active state
*/
Button.prototype['toggle'] = function () {
var triggerChangeEvent = true
var rootElement = $(this._element).closest(Button._Selector.DATA_TOGGLE)[0]
if (rootElement) {
var input = $(this._element).find(Button._Selector.INPUT)[0]
if (input) {
if (input.type == 'radio') {
if (input.checked && $(this._element).hasClass(Button._ClassName.ACTIVE)) {
triggerChangeEvent = false
} else {
var activeElement = $(rootElement).find(Button._Selector.ACTIVE)[0]
if (activeElement) {
$(activeElement).removeClass(Button._ClassName.ACTIVE)
}
}
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.isLoading = false
}
Button.VERSION = '3.3.4'
Button.DEFAULTS = {
loadingText: 'loading...'
}
Button.prototype.setState = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state += 'Text'
if (data.resetText == null) $el.data('resetText', $el[val]())
// push to event loop to allow forms to submit
setTimeout($.proxy(function () {
$el[val](data[state] == null ? this.options[state] : data[state])
if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
} else if (this.isLoading) {
this.isLoading = false
$el.removeClass(d).removeAttr(d)
}
}, this), 0)
}
if (triggerChangeEvent) {
input.checked = !$(this._element).hasClass(Button._ClassName.ACTIVE)
$(this._element).trigger('change')
Button.prototype.toggle = function () {
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
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') {
if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
this.$element.toggleClass('active')
}
$input.prop('checked', this.$element.hasClass('active'))
if (changed) $input.trigger('change')
} else {
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
this.$element.toggleClass('active')
}
} else {
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(Button._ClassName.ACTIVE))
}
if (triggerChangeEvent) {
$(this._element).toggleClass(Button._ClassName.ACTIVE)
}
}
// BUTTON PLUGIN DEFINITION
// ========================
/**
* ------------------------------------------------------------------------
* jQuery Interface + noConflict implementaiton
* ------------------------------------------------------------------------
*/
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
/**
* @const
* @type {Function}
*/
$.fn[Button._NAME] = Button._jQueryInterface
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
/**
* @const
* @type {Function}
*/
$.fn[Button._NAME]['Constructor'] = Button
var old = $.fn.button
$.fn.button = Plugin
$.fn.button.Constructor = Button
/**
* @const
* @type {Function}
*/
$.fn[Button._NAME]['noConflict'] = function () {
$.fn[Button._NAME] = Button._JQUERY_NO_CONFLICT
return this
}
// BUTTON NO CONFLICT
// ==================
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
*/
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
$(document)
.on('click.bs.button.data-api', Button._Selector.DATA_TOGGLE_CARROT, function (event) {
event.preventDefault()
var button = event.target
// BUTTON DATA-API
// ===============
if (!$(button).hasClass(Button._ClassName.BUTTON)) {
button = $(button).closest(Button._Selector.BUTTON)
}
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
Plugin.call($btn, 'toggle')
if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
Button._jQueryInterface.call($(button), 'toggle')
})
.on('focus.bs.button.data-api blur.bs.button.data-api', Button._Selector.DATA_TOGGLE_CARROT, function (event) {
var button = $(event.target).closest(Button._Selector.BUTTON)[0]
$(button).toggleClass(Button._ClassName.FOCUS, /^focus(in)?$/.test(event.type))
})
}(jQuery);
/** =======================================================================
* Bootstrap: carousel.js v4.0.0
/* ========================================================================
* Bootstrap: carousel.js v3.3.4
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ========================================================================
* @fileoverview - Bootstrap's carousel. A slideshow component for cycling
* through elements, like a carousel. Nested carousels are not supported.
*
* Public Methods & Properties:
*
* + $.carousel
* + $.carousel.noConflict
* + $.carousel.Constructor
* + $.carousel.Constructor.VERSION
* + $.carousel.Constructor.Defaults
* + $.carousel.Constructor.Defaults.interval
* + $.carousel.Constructor.Defaults.pause
* + $.carousel.Constructor.Defaults.wrap
* + $.carousel.Constructor.Defaults.keyboard
* + $.carousel.Constructor.Defaults.slide
* + $.carousel.Constructor.prototype.next
* + $.carousel.Constructor.prototype.prev
* + $.carousel.Constructor.prototype.pause
* + $.carousel.Constructor.prototype.cycle
*
* ========================================================================
*/
'use strict';
/**
* Our carousel class.
* @param {Element!} element
* @param {Object=} opt_config
* @constructor
*/
var Carousel = function (element, opt_config) {
/** @private {Element} */
this._element = $(element)[0]
/** @private {Element} */
this._indicatorsElement = $(this._element).find(Carousel._Selector.INDICATORS)[0]
/** @private {?Object} */
this._config = opt_config || null
/** @private {boolean} */
this._isPaused = false
/** @private {boolean} */
this._isSliding = false
/** @private {?number} */
this._interval = null
/** @private {?Element} */
this._activeElement = null
/** @private {?Array} */
this._items = null
this._addEventListeners()
}
/**
* @const
* @type {string}
*/
Carousel['VERSION'] = '4.0.0'
/**
* @const
* @type {Object}
*/
Carousel['Defaults'] = {
'interval' : 5000,
'pause' : 'hover',
'wrap' : true,
'keyboard' : true,
'slide' : false
}
/**
* @const
* @type {string}
* @private
*/
Carousel._NAME = 'carousel'
/**
* @const
* @type {string}
* @private
*/
Carousel._DATA_KEY = 'bs.carousel'
/**
* @const
* @type {number}
* @private
*/
Carousel._TRANSITION_DURATION = 600
/**
* @const
* @enum {string}
* @private
*/
Carousel._Direction = {
NEXT : 'next',
PREVIOUS : 'prev'
}
/**
* @const
* @enum {string}
* @private
*/
Carousel._Event = {
SLIDE : 'slide.bs.carousel',
SLID : 'slid.bs.carousel'
}
/**
* @const
* @enum {string}
* @private
*/
Carousel._ClassName = {
CAROUSEL : 'carousel',
ACTIVE : 'active',
SLIDE : 'slide',
RIGHT : 'right',
LEFT : 'left',
ITEM : 'carousel-item'
}
/**
* @const
* @enum {string}
* @private
*/
Carousel._Selector = {
ACTIVE : '.active',
ACTIVE_ITEM : '.active.carousel-item',
ITEM : '.carousel-item',
NEXT_PREV : '.next, .prev',
INDICATORS : '.carousel-indicators'
}
/**
* @const
* @type {Function}
* @private
*/
Carousel._JQUERY_NO_CONFLICT = $.fn[Carousel._NAME]
/**
* @param {Object=} opt_config
* @this {jQuery}
* @return {jQuery}
* @private
*/
Carousel._jQueryInterface = function (opt_config) {
return this.each(function () {
var data = $(this).data(Carousel._DATA_KEY)
var config = $.extend({}, Carousel['Defaults'], $(this).data(), typeof opt_config == 'object' && opt_config)
var action = typeof opt_config == 'string' ? opt_config : config.slide
if (!data) {
data = new Carousel(this, config)
$(this).data(Carousel._DATA_KEY, data)
}
if (typeof opt_config == 'number') {
data.to(opt_config)
} else if (action) {
data[action]()
} else if (config.interval) {
data['pause']()
data['cycle']()
}
})
}
* ======================================================================== */
/**
* Click handler for data api
* @param {Event} event
* @this {Element}
* @private
*/
Carousel._dataApiClickHandler = function (event) {
var selector = Bootstrap.getSelectorFromElement(this)
+function ($) {
'use strict';
if (!selector) {
return
}
var target = $(selector)[0]
if (!target || !$(target).hasClass(Carousel._ClassName.CAROUSEL)) {
return
}
// CAROUSEL CLASS DEFINITION
// =========================
var config = $.extend({}, $(target).data(), $(this).data())
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused = null
this.sliding = null
this.interval = null
this.$active = null
this.$items = null
var slideIndex = this.getAttribute('data-slide-to')
if (slideIndex) {
config.interval = false
}
Carousel._jQueryInterface.call($(target), config)
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
if (slideIndex) {
$(target).data(Carousel._DATA_KEY).to(slideIndex)
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))
}
event.preventDefault()
}
/**
* Advance the carousel to the next slide
*/
Carousel.prototype['next'] = function () {
if (!this._isSliding) {
this._slide(Carousel._Direction.NEXT)
}
}
Carousel.VERSION = '3.3.4'
Carousel.TRANSITION_DURATION = 600
/**
* Return the carousel to the previous slide
*/
Carousel.prototype['prev'] = function () {
if (!this._isSliding) {
this._slide(Carousel._Direction.PREVIOUS)
Carousel.DEFAULTS = {
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
}
Carousel.prototype.keydown = function (e) {
if (/input|textarea/i.test(e.target.tagName)) return
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
/**
* Pause the carousel cycle
* @param {Event=} opt_event
*/
Carousel.prototype['pause'] = function (opt_event) {
if (!opt_event) {
this._isPaused = true
e.preventDefault()
}
if ($(this._element).find(Carousel._Selector.NEXT_PREV)[0] && Bootstrap.transition) {
$(this._element).trigger(Bootstrap.transition.end)
this['cycle'](true)
}
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
clearInterval(this._interval)
this._interval = null
}
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
/**
* Cycle to the next carousel item
* @param {Event|boolean=} opt_event
*/
Carousel.prototype['cycle'] = function (opt_event) {
if (!opt_event) {
this._isPaused = false
return this
}
if (this._interval) {
clearInterval(this._interval)
this._interval = null
Carousel.prototype.getItemIndex = function (item) {
this.$items = item.parent().children('.item')
return this.$items.index(item || this.$active)
}
if (this._config['interval'] && !this._isPaused) {
this._interval = setInterval(this['next'].bind(this), this._config['interval'])
Carousel.prototype.getItemForDirection = function (direction, active) {
var activeIndex = this.getItemIndex(active)
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 itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
}
/**
* @return {Object}
*/
Carousel.prototype['getConfig'] = function () {
return this._config
}
Carousel.prototype.to = function (pos) {
var that = this
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
if (pos > (this.$items.length - 1) || pos < 0) return
/**
* Move active carousel item to specified index
* @param {number} index
*/
Carousel.prototype.to = function (index) {
this._activeElement = $(this._element).find(Carousel._Selector.ACTIVE_ITEM)[0]
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
if (activeIndex == pos) return this.pause().cycle()
var activeIndex = this._getItemIndex(this._activeElement)
if (index > (this._items.length - 1) || index < 0) {
return
}
if (this._isSliding) {
$(this._element).one(Carousel._Event.SLID, function () { this.to(index) }.bind(this))
return
return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
}
if (activeIndex == index) {
this['pause']()
this['cycle']()
return
}
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
var direction = index > activeIndex ?
Carousel._Direction.NEXT :
Carousel._Direction.PREVIOUS
this._slide(direction, this._items[index])
}
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearInterval(this.interval)
/**
* Add event listeners to root element
* @private
*/
Carousel.prototype._addEventListeners = function () {
if (this._config['keyboard']) {
$(this._element).on('keydown.bs.carousel', this._keydown.bind(this))
return this
}
if (this._config['pause'] == 'hover' && !('ontouchstart' in document.documentElement)) {
$(this._element)
.on('mouseenter.bs.carousel', this['pause'].bind(this))
.on('mouseleave.bs.carousel', this['cycle'].bind(this))
Carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
}
/**
* Keydown handler
* @param {Event} event
* @private
*/
Carousel.prototype._keydown = function (event) {
event.preventDefault()
if (/input|textarea/i.test(event.target.tagName)) return
switch (event.which) {
case 37: this['prev'](); break
case 39: this['next'](); break
default: return
}
}
/**
* Get item index
* @param {Element} element
* @return {number}
* @private
*/
Carousel.prototype._getItemIndex = function (element) {
this._items = $.makeArray($(element).parent().find(Carousel._Selector.ITEM))
return this._items.indexOf(element)
}
/**
* Get next displayed item based on direction
* @param {Carousel._Direction} direction
* @param {Element} activeElement
* @return {Element}
* @private
*/
Carousel.prototype._getItemByDirection = function (direction, activeElement) {
var activeIndex = this._getItemIndex(activeElement)
var isGoingToWrap = (direction === Carousel._Direction.PREVIOUS && activeIndex === 0) ||
(direction === Carousel._Direction.NEXT && activeIndex == (this._items.length - 1))
if (isGoingToWrap && !this._config['wrap']) {
return activeElement
Carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
var delta = direction == Carousel._Direction.PREVIOUS ? -1 : 1
var itemIndex = (activeIndex + delta) % this._items.length
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]
}
Carousel.prototype.slide = function (type, next) {
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 that = this
/**
* Trigger slide event on element
* @param {Element} relatedTarget
* @param {Carousel._ClassName} directionalClassname
* @return {$.Event}
* @private
*/
Carousel.prototype._triggerSlideEvent = function (relatedTarget, directionalClassname) {
var slideEvent = $.Event(Carousel._Event.SLIDE, {
relatedTarget: relatedTarget,
direction: directionalClassname
})
$(this._element).trigger(slideEvent)
if ($next.hasClass('active')) return (this.sliding = false)
return slideEvent
}
var relatedTarget = $next[0]
var slideEvent = $.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent)
if (slideEvent.isDefaultPrevented()) return
this.sliding = true
/**
* Set the active indicator if available
* @param {Element} element
* @private
*/
Carousel.prototype._setActiveIndicatorElement = function (element) {
if (this._indicatorsElement) {
$(this._indicatorsElement)
.find(Carousel._Selector.ACTIVE)
.removeClass(Carousel._ClassName.ACTIVE)
isCycling && this.pause()
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]
if (nextIndicator) {
$(nextIndicator).addClass(Carousel._ClassName.ACTIVE)
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator && $nextIndicator.addClass('active')
}
}
}
/**
* Slide the carousel element in a direction
* @param {Carousel._Direction} direction
* @param {Element=} opt_nextElement
*/
Carousel.prototype._slide = function (direction, opt_nextElement) {
var activeElement = $(this._element).find(Carousel._Selector.ACTIVE_ITEM)[0]
var nextElement = opt_nextElement || activeElement && this._getItemByDirection(direction, activeElement)
var isCycling = !!this._interval
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
if ($.support.transition && this.$element.hasClass('slide')) {
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
$active
.one('bsTransitionEnd', function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () {
that.$element.trigger(slidEvent)
}, 0)
})
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
} else {
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger(slidEvent)
}
var directionalClassName = direction == Carousel._Direction.NEXT ?
Carousel._ClassName.LEFT :
Carousel._ClassName.RIGHT
isCycling && this.cycle()
if (nextElement && $(nextElement).hasClass(Carousel._ClassName.ACTIVE)) {
this._isSliding = false
return
return this
}
var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName)
if (slideEvent.isDefaultPrevented()) {
return
}
if (!activeElement || !nextElement) {
// some weirdness is happening, so we bail (maybe throw exception here alerting user that they're dom is off
return
}
// CAROUSEL PLUGIN DEFINITION
// ==========================
this._isSliding = true
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (isCycling) {
this['pause']()
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
this._setActiveIndicatorElement(nextElement)
var old = $.fn.carousel
var slidEvent = $.Event(Carousel._Event.SLID, { relatedTarget: nextElement, direction: directionalClassName })
$.fn.carousel = Plugin
$.fn.carousel.Constructor = Carousel
if (Bootstrap.transition && $(this._element).hasClass(Carousel._ClassName.SLIDE)) {
$(nextElement).addClass(direction)
Bootstrap.reflow(nextElement)
// CAROUSEL NO CONFLICT
// ====================
$(activeElement).addClass(directionalClassName)
$(nextElement).addClass(directionalClassName)
$(activeElement)
.one(Bootstrap.TRANSITION_END, function () {
$(nextElement)
.removeClass(directionalClassName)
.removeClass(direction)
$(nextElement).addClass(Carousel._ClassName.ACTIVE)
$(activeElement)
.removeClass(Carousel._ClassName.ACTIVE)
.removeClass(direction)
.removeClass(directionalClassName)
this._isSliding = false
setTimeout(function () {
$(this._element).trigger(slidEvent)
}.bind(this), 0)
}.bind(this))
.emulateTransitionEnd(Carousel._TRANSITION_DURATION)
} else {
$(activeElement).removeClass(Carousel._ClassName.ACTIVE)
$(nextElement).addClass(Carousel._ClassName.ACTIVE)
this._isSliding = false
$(this._element).trigger(slidEvent)
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
if (isCycling) {
this['cycle']()
}
}
// CAROUSEL DATA-API
// =================
/**
* ------------------------------------------------------------------------
* jQuery Interface + noConflict implementaiton
* ------------------------------------------------------------------------
*/
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
if (!$target.hasClass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
/**
* @const
* @type {Function}
*/
$.fn[Carousel._NAME] = Carousel._jQueryInterface
/**
* @const
* @type {Function}
*/
$.fn[Carousel._NAME]['Constructor'] = Carousel
/**
* @const
* @type {Function}
*/
$.fn[Carousel._NAME]['noConflict'] = function () {
$.fn[Carousel._NAME] = Carousel._JQUERY_NO_CONFLICT
return this
}
Plugin.call($target, options)
if (slideIndex) {
$target.data('bs.carousel').to(slideIndex)
}
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
*/
e.preventDefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', Carousel._dataApiClickHandler)
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
Carousel._jQueryInterface.call($carousel, /** @type {Object} */ ($carousel.data()))
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
Plugin.call($carousel, $carousel.data())
})
})
})
}(jQuery);
/** =======================================================================
* Bootstrap: collapse.js v4.0.0
/* ========================================================================
* Bootstrap: collapse.js v3.3.4
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ========================================================================
* @fileoverview - Bootstrap's collapse plugin. Flexible support for
* collapsible components like accordions and navigation.
*
* Public Methods & Properties:
*
* + $.carousel
* + $.carousel.noConflict
* + $.carousel.Constructor
* + $.carousel.Constructor.VERSION
* + $.carousel.Constructor.Defaults
* + $.carousel.Constructor.Defaults.toggle
* + $.carousel.Constructor.Defaults.trigger
* + $.carousel.Constructor.Defaults.parent
* + $.carousel.Constructor.prototype.toggle
* + $.carousel.Constructor.prototype.show
* + $.carousel.Constructor.prototype.hide
*
* ========================================================================
*/
* ======================================================================== */
'use strict';
+function ($) {
'use strict';
/**
* Our collapse class.
* @param {Element!} element
* @param {Object=} opt_config
* @constructor
*/
var Collapse = function (element, opt_config) {
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
/** @private {Element} */
this._element = element
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning = null
/** @private {Object} */
this._config = $.extend({}, Collapse['Defaults'], opt_config)
if (this.options.parent) {
this.$parent = this.getParent()
} else {
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
/** @private {Element} */
this._trigger = typeof this._config['trigger'] == 'string' ?
$(this._config['trigger'])[0] : this._config['trigger']
if (this.options.toggle) this.toggle()
}
/** @private {boolean} */
this._isTransitioning = false
Collapse.VERSION = '3.3.4'
/** @private {?Element} */
this._parent = this._config['parent'] ? this._getParent() : null
Collapse.TRANSITION_DURATION = 350
if (!this._config['parent']) {
this._addAriaAndCollapsedClass(this._element, this._trigger)
Collapse.DEFAULTS = {
toggle: true
}
if (this._config['toggle']) {
this['toggle']()
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
}
/**
* @const
* @type {string}
*/
Collapse['VERSION'] = '4.0.0'
/**
* @const
* @type {Object}
*/
Collapse['Defaults'] = {
'toggle' : true,
'trigger' : '[data-toggle="collapse"]',
'parent' : null
}
/**
* @const
* @type {string}
* @private
*/
Collapse._NAME = 'collapse'
/**
* @const
* @type {string}
* @private
*/
Collapse._DATA_KEY = 'bs.collapse'
/**
* @const
* @type {number}
* @private
*/
Collapse._TRANSITION_DURATION = 600
/**
* @const
* @type {Function}
* @private
*/
Collapse._JQUERY_NO_CONFLICT = $.fn[Collapse._NAME]
/**
* @const
* @enum {string}
* @private
*/
Collapse._Event = {
SHOW : 'show.bs.collapse',
SHOWN : 'shown.bs.collapse',
HIDE : 'hide.bs.collapse',
HIDDEN : 'hidden.bs.collapse'
}
/**
* @const
* @enum {string}
* @private
*/
Collapse._ClassName = {
IN : 'in',
COLLAPSE : 'collapse',
COLLAPSING : 'collapsing',
COLLAPSED : 'collapsed'
}
/**
* @const
* @enum {string}
* @private
*/
Collapse._Dimension = {
WIDTH : 'width',
HEIGHT : 'height'
}
/**
* @const
* @enum {string}
* @private
*/
Collapse._Selector = {
ACTIVES : '.panel > .in, .panel > .collapsing'
}
/**
* Provides the jQuery Interface for the alert component.
* @param {Object|string=} opt_config
* @this {jQuery}
* @return {jQuery}
* @private
*/
Collapse._jQueryInterface = function (opt_config) {
return this.each(function () {
var $this = $(this)
var data = $this.data(Collapse._DATA_KEY)
var config = $.extend({}, Collapse['Defaults'], $this.data(), typeof opt_config == 'object' && opt_config)
if (!data && config['toggle'] && opt_config == 'show') {
config['toggle'] = false
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
if (!data) {
data = new Collapse(this, config)
$this.data(Collapse._DATA_KEY, data)
}
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (typeof opt_config == 'string') {
data[opt_config]()
if (actives && actives.length) {
activesData = actives.data('bs.collapse')
if (activesData && activesData.transitioning) return
}
})
}
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
/**
* Function for getting target element from element
* @return {Element}
* @private
*/
Collapse._getTargetFromElement = function (element) {
var selector = Bootstrap.getSelectorFromElement(element)
return selector ? $(selector)[0] : null
}
if (actives && actives.length) {
Plugin.call(actives, 'hide')
activesData || actives.data('bs.collapse', null)
}
/**
* Toggles the collapse element based on the presence of the 'in' class
*/
Collapse.prototype['toggle'] = function () {
if ($(this._element).hasClass(Collapse._ClassName.IN)) {
this['hide']()
} else {
this['show']()
}
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
/**
* Show's the collapsing element
*/
Collapse.prototype['show'] = function () {
if (this._isTransitioning || $(this._element).hasClass(Collapse._ClassName.IN)) {
return
}
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
var activesData, actives
this.transitioning = 1
if (this._parent) {
actives = $.makeArray($(Collapse._Selector.ACTIVES))
if (!actives.length) {
actives = null
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element
.trigger('shown.bs.collapse')
}
}
if (actives) {
activesData = $(actives).data(Collapse._DATA_KEY)
if (activesData && activesData._isTransitioning) {
return
}
}
if (!$.support.transition) return complete.call(this)
var startEvent = $.Event(Collapse._Event.SHOW)
$(this._element).trigger(startEvent)
if (startEvent.isDefaultPrevented()) {
return
}
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
if (actives) {
Collapse._jQueryInterface.call($(actives), 'hide')
if (!activesData) {
$(actives).data(Collapse._DATA_KEY, null)
}
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
var dimension = this._getDimension()
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
$(this._element)
.removeClass(Collapse._ClassName.COLLAPSE)
.addClass(Collapse._ClassName.COLLAPSING)
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
this._element.style[dimension] = 0
this._element.setAttribute('aria-expanded', true)
var dimension = this.dimension()
if (this._trigger) {
$(this._trigger).removeClass(Collapse._ClassName.COLLAPSED)
this._trigger.setAttribute('aria-expanded', true)
}
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this['setTransitioning'](true)
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
var complete = function () {
$(this._element)
.removeClass(Collapse._ClassName.COLLAPSING)
.addClass(Collapse._ClassName.COLLAPSE)
.addClass(Collapse._ClassName.IN)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this._element.style[dimension] = ''
this.transitioning = 1
this['setTransitioning'](false)
var complete = function () {
this.transitioning = 0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
$(this._element).trigger(Collapse._Event.SHOWN)
}.bind(this)
if (!$.support.transition) return complete.call(this)
if (!Bootstrap.transition) {
complete()
return
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
var scrollSize = 'scroll' + (dimension[0].toUpperCase() + dimension.slice(1))
$(this._element)
.one(Bootstrap.TRANSITION_END, complete)
.emulateTransitionEnd(Collapse._TRANSITION_DURATION)
this._element.style[dimension] = this._element[scrollSize] + 'px'
}
/**
* Hides's the collapsing element
*/
Collapse.prototype['hide'] = function () {
if (this._isTransitioning || !$(this._element).hasClass(Collapse._ClassName.IN)) {
return
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
var startEvent = $.Event(Collapse._Event.HIDE)
$(this._element).trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this._getDimension()
var offsetDimension = dimension === Collapse._Dimension.WIDTH ?
'offsetWidth' : 'offsetHeight'
this._element.style[dimension] = this._element[offsetDimension] + 'px'
Bootstrap.reflow(this._element)
$(this._element)
.addClass(Collapse._ClassName.COLLAPSING)
.removeClass(Collapse._ClassName.COLLAPSE)
.removeClass(Collapse._ClassName.IN)
this._element.setAttribute('aria-expanded', false)
if (this._trigger) {
$(this._trigger).addClass(Collapse._ClassName.COLLAPSED)
this._trigger.setAttribute('aria-expanded', false)
Collapse.prototype.getParent = function () {
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
this['setTransitioning'](true)
var complete = function () {
this['setTransitioning'](false)
$(this._element)
.removeClass(Collapse._ClassName.COLLAPSING)
.addClass(Collapse._ClassName.COLLAPSE)
.trigger(Collapse._Event.HIDDEN)
}.bind(this)
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
var isOpen = $element.hasClass('in')
this._element.style[dimension] = 0
if (!Bootstrap.transition) {
return complete()
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
$(this._element)
.one(Bootstrap.TRANSITION_END, complete)
.emulateTransitionEnd(Collapse._TRANSITION_DURATION)
}
function getTargetFromTrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
/**
* @param {boolean} isTransitioning
*/
Collapse.prototype['setTransitioning'] = function (isTransitioning) {
this._isTransitioning = isTransitioning
}
/**
* Returns the collapsing dimension
* @return {string}
* @private
*/
Collapse.prototype._getDimension = function () {
var hasWidth = $(this._element).hasClass(Collapse._Dimension.WIDTH)
return hasWidth ? Collapse._Dimension.WIDTH : Collapse._Dimension.HEIGHT
}
/**
* Returns the parent element
* @return {Element}
* @private
*/
Collapse.prototype._getParent = function () {
var selector = '[data-toggle="collapse"][data-parent="' + this._config['parent'] + '"]'
var parent = $(this._config['parent'])[0]
var elements = /** @type {Array.<Element>} */ ($.makeArray($(parent).find(selector)))
for (var i = 0; i < elements.length; i++) {
this._addAriaAndCollapsedClass(Collapse._getTargetFromElement(elements[i]), elements[i])
return $(target)
}
return parent
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
/**
* Returns the parent element
* @param {Element} element
* @param {Element} trigger
* @private
*/
Collapse.prototype._addAriaAndCollapsedClass = function (element, trigger) {
if (element) {
var isOpen = $(element).hasClass(Collapse._ClassName.IN)
element.setAttribute('aria-expanded', isOpen)
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (trigger) {
trigger.setAttribute('aria-expanded', isOpen)
$(trigger).toggleClass(Collapse._ClassName.COLLAPSED, !isOpen)
}
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
}
var old = $.fn.collapse
$.fn.collapse = Plugin
$.fn.collapse.Constructor = Collapse
/**
* ------------------------------------------------------------------------
* jQuery Interface + noConflict implementaiton
* ------------------------------------------------------------------------
*/
/**
* @const
* @type {Function}
*/
$.fn[Collapse._NAME] = Collapse._jQueryInterface
/**
* @const
* @type {Function}
*/
$.fn[Collapse._NAME]['Constructor'] = Collapse
// COLLAPSE NO CONFLICT
// ====================
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
/**
* @const
* @type {Function}
*/
$.fn[Collapse._NAME]['noConflict'] = function () {
$.fn[Collapse._NAME] = Collapse._JQUERY_NO_CONFLICT
return this
}
// COLLAPSE DATA-API
// =================
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
*/
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this)
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (event) {
event.preventDefault()
if (!$this.attr('data-target')) e.preventDefault()
var target = Collapse._getTargetFromElement(this)
var $target = getTargetFromTrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
var data = $(target).data(Collapse._DATA_KEY)
var config = data ? 'toggle' : $.extend({}, $(this).data(), { trigger: this })
Plugin.call($target, option)
})
Collapse._jQueryInterface.call($(target), config)
})
}(jQuery);
/** =======================================================================
* Bootstrap: dropdown.js v4.0.0
* http://getbootstrap.com/javascript/#dropdown
/* ========================================================================
* Bootstrap: dropdown.js v3.3.4
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ========================================================================
* @fileoverview - Add dropdown menus to nearly anything with this simple
* plugin, including the navbar, tabs, and pills.
*
* Public Methods & Properties:
*
* + $.dropdown
* + $.dropdown.noConflict
* + $.dropdown.Constructor
* + $.dropdown.Constructor.VERSION
* + $.dropdown.Constructor.prototype.toggle
*
* ========================================================================
*/
'use strict';
/**
* Our dropdown class.
* @param {Element!} element
* @constructor
*/
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this['toggle'])
}
/**
* @const
* @type {string}
*/
Dropdown['VERSION'] = '4.0.0'
/**
* @const
* @type {string}
* @private
*/
Dropdown._NAME = 'dropdown'
/**
* @const
* @type {string}
* @private
*/
Dropdown._DATA_KEY = 'bs.dropdown'
/**
* @const
* @type {Function}
* @private
*/
Dropdown._JQUERY_NO_CONFLICT = $.fn[Dropdown._NAME]
/**
* @const
* @enum {string}
* @private
*/
Dropdown._Event = {
HIDE : 'hide.bs.dropdown',
HIDDEN : 'hidden.bs.dropdown',
SHOW : 'show.bs.dropdown',
SHOWN : 'shown.bs.dropdown'
}
/**
* @const
* @enum {string}
* @private
*/
Dropdown._ClassName = {
BACKDROP : 'dropdown-backdrop',
DISABLED : 'disabled',
OPEN : 'open'
}
/**
* @const
* @enum {string}
* @private
*/
Dropdown._Selector = {
BACKDROP : '.dropdown-backdrop',
DATA_TOGGLE : '[data-toggle="dropdown"]',
FORM_CHILD : '.dropdown form',
ROLE_MENU : '[role="menu"]',
ROLE_LISTBOX : '[role="listbox"]',
NAVBAR_NAV : '.navbar-nav',
VISIBLE_ITEMS : '[role="menu"] li:not(.divider) a, [role="listbox"] li:not(.divider) a'
}
/**
* Provides the jQuery Interface for the alert component.
* @param {string=} opt_config
* @this {jQuery}
* @return {jQuery}
* @private
*/
Dropdown._jQueryInterface = function (opt_config) {
return this.each(function () {
var data = $(this).data(Dropdown._DATA_KEY)
if (!data) {
$(this).data(Dropdown._DATA_KEY, (data = new Dropdown(this)))
}
* ======================================================================== */
if (typeof opt_config === 'string') {
data[opt_config].call(this)
}
})
}
+function ($) {
'use strict';
/**
* @param {Event=} opt_event
* @private
*/
Dropdown._clearMenus = function (opt_event) {
if (opt_event && opt_event.which == 3) {
return
}
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = $(Dropdown._Selector.BACKDROP)[0]
if (backdrop) {
backdrop.parentNode.removeChild(backdrop)
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle="dropdown"]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
var toggles = /** @type {Array.<Element>} */ ($.makeArray($(Dropdown._Selector.DATA_TOGGLE)))
for (var i = 0; i < toggles.length; i++) {
var parent = Dropdown._getParentFromElement(toggles[i])
var relatedTarget = { 'relatedTarget': toggles[i] }
Dropdown.VERSION = '3.3.4'
if (!$(parent).hasClass(Dropdown._ClassName.OPEN)) {
continue
}
function getParent($this) {
var selector = $this.attr('data-target')
var hideEvent = $.Event(Dropdown._Event.HIDE, relatedTarget)
$(parent).trigger(hideEvent)
if (hideEvent.isDefaultPrevented()) {
continue
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
toggles[i].setAttribute('aria-expanded', 'false')
var $parent = selector && $(selector)
$(parent)
.removeClass(Dropdown._ClassName.OPEN)
.trigger(Dropdown._Event.HIDDEN, relatedTarget)
return $parent && $parent.length ? $parent : $this.parent()
}
}
function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $this = $(this)
var $parent = getParent($this)
var relatedTarget = { relatedTarget: this }
/**
* @param {Element} element
* @return {Element}
* @private
*/
Dropdown._getParentFromElement = function (element) {
var selector = Bootstrap.getSelectorFromElement(element)
if (!$parent.hasClass('open')) return
if (selector) {
var parent = $(selector)[0]
}
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
return /** @type {Element} */ (parent || element.parentNode)
}
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
/**
* @param {Event} event
* @this {Element}
* @private
*/
Dropdown._dataApiKeydownHandler = function (event) {
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
event.preventDefault()
event.stopPropagation()
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if (this.disabled || $(this).hasClass(Dropdown._ClassName.DISABLED)) {
return
}
if ($this.is('.disabled, :disabled')) return
var parent = Dropdown._getParentFromElement(this)
var isActive = $(parent).hasClass(Dropdown._ClassName.OPEN)
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if ((!isActive && event.which != 27) || (isActive && event.which == 27)) {
if (event.which == 27) {
var toggle = $(parent).find(Dropdown._Selector.DATA_TOGGLE)[0]
$(toggle).trigger('focus')
}
$(this).trigger('click')
return
}
clearMenus()
var items = $.makeArray($(Dropdown._Selector.VISIBLE_ITEMS))
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$(document.createElement('div'))
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)
}
items = items.filter(function (item) {
return item.offsetWidth || item.offsetHeight
})
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (!items.length) {
return
}
if (e.isDefaultPrevented()) return
var index = items.indexOf(event.target)
$this
.trigger('focus')
.attr('aria-expanded', 'true')
if (event.which == 38 && index > 0) index-- // up
if (event.which == 40 && index < items.length - 1) index++ // down
if (!~index) index = 0
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
items[index].focus()
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
/**
* Toggles the dropdown
* @this {Element}
* @return {boolean|undefined}
*/
Dropdown.prototype['toggle'] = function () {
if (this.disabled || $(this).hasClass(Dropdown._ClassName.DISABLED)) {
return
}
var $this = $(this)
var parent = Dropdown._getParentFromElement(this)
var isActive = $(parent).hasClass(Dropdown._ClassName.OPEN)
e.preventDefault()
e.stopPropagation()
Dropdown._clearMenus()
if ($this.is('.disabled, :disabled')) return
if (isActive) {
return false
}
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if ('ontouchstart' in document.documentElement && !$(parent).closest(Dropdown._Selector.NAVBAR_NAV).length) {
// if mobile we use a backdrop because click events don't delegate
var dropdown = document.createElement('div')
dropdown.className = Dropdown._ClassName.BACKDROP
this.parentNode.insertBefore(this, dropdown)
$(dropdown).on('click', Dropdown._clearMenus)
}
if (!isActive && e.which != 27 || isActive && e.which == 27) {
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var relatedTarget = { 'relatedTarget': this }
var showEvent = $.Event(Dropdown._Event.SHOW, relatedTarget)
var desc = ' li:not(.disabled):visible a'
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
$(parent).trigger(showEvent)
if (!$items.length) return
if (showEvent.isDefaultPrevented()) {
return
}
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 (!~index) index = 0
this.focus()
this.setAttribute('aria-expanded', 'true')
$items.eq(index).trigger('focus')
}
$(parent).toggleClass(Dropdown._ClassName.OPEN)
$(parent).trigger(Dropdown._Event.SHOWN, relatedTarget)
// DROPDOWN PLUGIN DEFINITION
// ==========================
return false
}
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
/**
* ------------------------------------------------------------------------
* jQuery Interface + noConflict implementaiton
* ------------------------------------------------------------------------
*/
var old = $.fn.dropdown
/**
* @const
* @type {Function}
*/
$.fn[Dropdown._NAME] = Dropdown._jQueryInterface
$.fn.dropdown = Plugin
$.fn.dropdown.Constructor = Dropdown
/**
* @const
* @type {Function}
*/
$.fn[Dropdown._NAME]['Constructor'] = Dropdown
// DROPDOWN NO CONFLICT
// ====================
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
/**
* @const
* @type {Function}
*/
$.fn[Dropdown._NAME]['noConflict'] = function () {
$.fn[Dropdown._NAME] = Dropdown._JQUERY_NO_CONFLICT
return this
}
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
/**
* ------------------------------------------------------------------------
* Data Api implementation
* ------------------------------------------------------------------------
*/
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
$(document)
.on('click.bs.dropdown.data-api', Dropdown._clearMenus)
.on('click.bs.dropdown.data-api', Dropdown._Selector.FORM_CHILD, function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', Dropdown._Selector.DATA_TOGGLE, Dropdown.prototype['toggle'])
.on('keydown.bs.dropdown.data-api', Dropdown._Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
.on('keydown.bs.dropdown.data-api', Dropdown._Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler)
.on('keydown.bs.dropdown.data-api', Dropdown._Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler)
}(jQuery);
jQuery.event.prototype.handleObj = function () {}
jQuery.event.prototype.handleObj.handler = function () {}
$.event.special = function () {}
$.event.trueHover = true
$.offset = {}
$.offset.setOffset = function (a,b,c) {}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -130,7 +130,7 @@
</script>
<!-- Plugin sources -->
<script src="../../js/util.js"></script>
<script>$.support.transition = false</script>
<script src="../../js/alert.js"></script>
<script src="../../js/button.js"></script>
<script src="../../js/carousel.js"></script>
......@@ -141,6 +141,7 @@
<script src="../../js/tab.js"></script>
<script src="../../js/tooltip.js"></script>
<script src="../../js/popover.js"></script>
<script src="../../js/affix.js"></script>
<!-- Unit tests -->
<script src="unit/alert.js"></script>
......@@ -153,6 +154,7 @@
<script src="unit/tab.js"></script>
<script src="unit/tooltip.js"></script>
<script src="unit/popover.js"></script>
<script src="unit/affix.js"></script>
</head>
<body>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment