twitter-bootstrap4-rails 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/twitter/bootstrap4/rails.rb +10 -0
- data/lib/twitter/bootstrap4/rails/version.rb +7 -0
- data/sample/.gitignore +16 -0
- data/sample/Gemfile +47 -0
- data/sample/Gemfile.lock +124 -0
- data/sample/README.rdoc +28 -0
- data/sample/Rakefile +6 -0
- data/sample/app/assets/images/.keep +0 -0
- data/sample/app/assets/javascripts/application.js +17 -0
- data/sample/app/assets/javascripts/home.js.coffee +3 -0
- data/sample/app/assets/stylesheets/application.css +14 -0
- data/sample/app/assets/stylesheets/home.css.scss +3 -0
- data/sample/app/controllers/application_controller.rb +5 -0
- data/sample/app/controllers/concerns/.keep +0 -0
- data/sample/app/controllers/home_controller.rb +5 -0
- data/sample/app/helpers/application_helper.rb +2 -0
- data/sample/app/helpers/home_helper.rb +2 -0
- data/sample/app/mailers/.keep +0 -0
- data/sample/app/models/.keep +0 -0
- data/sample/app/models/concerns/.keep +0 -0
- data/sample/app/views/home/index.html.erb +70 -0
- data/sample/app/views/layouts/application.html.erb +14 -0
- data/sample/bin/bundle +3 -0
- data/sample/bin/rails +4 -0
- data/sample/bin/rake +4 -0
- data/sample/config.ru +4 -0
- data/sample/config/application.rb +23 -0
- data/sample/config/boot.rb +4 -0
- data/sample/config/database.yml +25 -0
- data/sample/config/environment.rb +5 -0
- data/sample/config/environments/development.rb +32 -0
- data/sample/config/environments/production.rb +80 -0
- data/sample/config/environments/test.rb +39 -0
- data/sample/config/initializers/backtrace_silencers.rb +7 -0
- data/sample/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample/config/initializers/inflections.rb +16 -0
- data/sample/config/initializers/mime_types.rb +5 -0
- data/sample/config/initializers/secret_token.rb +12 -0
- data/sample/config/initializers/session_store.rb +3 -0
- data/sample/config/initializers/wrap_parameters.rb +14 -0
- data/sample/config/locales/en.yml +23 -0
- data/sample/config/routes.rb +56 -0
- data/sample/db/seeds.rb +7 -0
- data/sample/lib/assets/.keep +0 -0
- data/sample/lib/tasks/.keep +0 -0
- data/sample/log/.keep +0 -0
- data/sample/public/404.html +58 -0
- data/sample/public/422.html +58 -0
- data/sample/public/500.html +57 -0
- data/sample/public/favicon.ico +0 -0
- data/sample/public/robots.txt +5 -0
- data/sample/test/controllers/.keep +0 -0
- data/sample/test/controllers/home_controller_test.rb +9 -0
- data/sample/test/fixtures/.keep +0 -0
- data/sample/test/helpers/.keep +0 -0
- data/sample/test/helpers/home_helper_test.rb +4 -0
- data/sample/test/integration/.keep +0 -0
- data/sample/test/mailers/.keep +0 -0
- data/sample/test/models/.keep +0 -0
- data/sample/test/test_helper.rb +15 -0
- data/sample/vendor/assets/javascripts/.keep +0 -0
- data/sample/vendor/assets/stylesheets/.keep +0 -0
- data/twitter-bootstrap4-rails.gemspec +36 -0
- data/vendor/assets/javascripts/bootstrap3.js +1 -0
- data/vendor/assets/javascripts/bootstrap3/.keep +0 -0
- data/vendor/assets/javascripts/bootstrap3/bootstrap.js +2363 -0
- data/vendor/assets/javascripts/bootstrap3/bootstrap.min.js +7 -0
- data/vendor/assets/javascripts/bootstrap4.js +1 -0
- data/vendor/assets/javascripts/bootstrap4/.keep +0 -0
- data/vendor/assets/javascripts/bootstrap4/bootstrap.js +3519 -0
- data/vendor/assets/javascripts/bootstrap4/bootstrap.min.js +7 -0
- data/vendor/assets/stylesheets/bootstrap3.css +3 -0
- data/vendor/assets/stylesheets/bootstrap3/.keep +0 -0
- data/vendor/assets/stylesheets/bootstrap3/bootstrap.css +6800 -0
- data/vendor/assets/stylesheets/bootstrap3/bootstrap.min.css +5 -0
- data/vendor/assets/stylesheets/bootstrap4.css +3 -0
- data/vendor/assets/stylesheets/bootstrap4/.keep +0 -0
- data/vendor/assets/stylesheets/bootstrap4/bootstrap.css +6301 -0
- data/vendor/assets/stylesheets/bootstrap4/bootstrap.min.css +6 -0
- metadata +207 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
3
|
+
* Copyright 2011-2015 Twitter, Inc.
|
4
|
+
* Licensed under the MIT license
|
5
|
+
*/
|
6
|
+
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),
|
7
|
+
d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
//=require bootstrap4/bootstrap.min.js
|
File without changes
|
@@ -0,0 +1,3519 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v4.0.0-alpha (http://getbootstrap.com)
|
3
|
+
* Copyright 2011-2015 Twitter, Inc.
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
5
|
+
*/
|
6
|
+
|
7
|
+
if (typeof jQuery === 'undefined') {
|
8
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
9
|
+
}
|
10
|
+
|
11
|
+
+function ($) {
|
12
|
+
var version = $.fn.jquery.split(' ')[0].split('.')
|
13
|
+
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
|
14
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
|
15
|
+
}
|
16
|
+
}(jQuery);
|
17
|
+
|
18
|
+
|
19
|
+
+function ($) {
|
20
|
+
|
21
|
+
/**
|
22
|
+
* --------------------------------------------------------------------------
|
23
|
+
* Bootstrap (v4.0.0): util.js
|
24
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
25
|
+
* --------------------------------------------------------------------------
|
26
|
+
*/
|
27
|
+
|
28
|
+
'use strict';
|
29
|
+
|
30
|
+
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
31
|
+
|
32
|
+
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
33
|
+
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
35
|
+
|
36
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
37
|
+
|
38
|
+
var Util = (function ($) {
|
39
|
+
|
40
|
+
/**
|
41
|
+
* ------------------------------------------------------------------------
|
42
|
+
* Private TransitionEnd Helpers
|
43
|
+
* ------------------------------------------------------------------------
|
44
|
+
*/
|
45
|
+
|
46
|
+
var transition = false;
|
47
|
+
|
48
|
+
var TransitionEndEvent = {
|
49
|
+
WebkitTransition: 'webkitTransitionEnd',
|
50
|
+
MozTransition: 'transitionend',
|
51
|
+
OTransition: 'oTransitionEnd otransitionend',
|
52
|
+
transition: 'transitionend'
|
53
|
+
};
|
54
|
+
|
55
|
+
// shoutout AngusCroll (https://goo.gl/pxwQGp)
|
56
|
+
function toType(obj) {
|
57
|
+
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
58
|
+
}
|
59
|
+
|
60
|
+
function isElement(obj) {
|
61
|
+
return (obj[0] || obj).nodeType;
|
62
|
+
}
|
63
|
+
|
64
|
+
function getSpecialTransitionEndEvent() {
|
65
|
+
return {
|
66
|
+
bindType: transition.end,
|
67
|
+
delegateType: transition.end,
|
68
|
+
handle: function handle(event) {
|
69
|
+
if ($(event.target).is(this)) {
|
70
|
+
return event.handleObj.handler.apply(this, arguments);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
};
|
74
|
+
}
|
75
|
+
|
76
|
+
function transitionEndTest() {
|
77
|
+
if (window.QUnit) {
|
78
|
+
return false;
|
79
|
+
}
|
80
|
+
|
81
|
+
var el = document.createElement('bootstrap');
|
82
|
+
|
83
|
+
for (var _name in TransitionEndEvent) {
|
84
|
+
if (el.style[_name] !== undefined) {
|
85
|
+
return { end: TransitionEndEvent[_name] };
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
return false;
|
90
|
+
}
|
91
|
+
|
92
|
+
function transitionEndEmulator(duration) {
|
93
|
+
var _this = this;
|
94
|
+
|
95
|
+
var called = false;
|
96
|
+
|
97
|
+
$(this).one(Util.TRANSITION_END, function () {
|
98
|
+
called = true;
|
99
|
+
});
|
100
|
+
|
101
|
+
setTimeout(function () {
|
102
|
+
if (!called) {
|
103
|
+
Util.triggerTransitionEnd(_this);
|
104
|
+
}
|
105
|
+
}, duration);
|
106
|
+
|
107
|
+
return this;
|
108
|
+
}
|
109
|
+
|
110
|
+
function setTransitionEndSupport() {
|
111
|
+
transition = transitionEndTest();
|
112
|
+
|
113
|
+
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
114
|
+
|
115
|
+
if (Util.supportsTransitionEnd()) {
|
116
|
+
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* --------------------------------------------------------------------------
|
122
|
+
* Public Util Api
|
123
|
+
* --------------------------------------------------------------------------
|
124
|
+
*/
|
125
|
+
|
126
|
+
var Util = {
|
127
|
+
|
128
|
+
TRANSITION_END: 'bsTransitionEnd',
|
129
|
+
|
130
|
+
getUID: function getUID(prefix) {
|
131
|
+
do {
|
132
|
+
prefix += ~ ~(Math.random() * 1000000);
|
133
|
+
} while (document.getElementById(prefix));
|
134
|
+
return prefix;
|
135
|
+
},
|
136
|
+
|
137
|
+
getSelectorFromElement: function getSelectorFromElement(element) {
|
138
|
+
var selector = element.getAttribute('data-target');
|
139
|
+
|
140
|
+
if (!selector) {
|
141
|
+
selector = element.getAttribute('href') || '';
|
142
|
+
selector = /^#[a-z]/i.test(selector) ? selector : null;
|
143
|
+
}
|
144
|
+
|
145
|
+
return selector;
|
146
|
+
},
|
147
|
+
|
148
|
+
reflow: function reflow(element) {
|
149
|
+
new Function('bs', 'return bs')(element.offsetHeight);
|
150
|
+
},
|
151
|
+
|
152
|
+
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
153
|
+
$(element).trigger(transition.end);
|
154
|
+
},
|
155
|
+
|
156
|
+
supportsTransitionEnd: function supportsTransitionEnd() {
|
157
|
+
return Boolean(transition);
|
158
|
+
},
|
159
|
+
|
160
|
+
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
161
|
+
for (var property in configTypes) {
|
162
|
+
if (configTypes.hasOwnProperty(property)) {
|
163
|
+
var expectedTypes = configTypes[property];
|
164
|
+
var value = config[property];
|
165
|
+
var valueType = undefined;
|
166
|
+
|
167
|
+
if (value && isElement(value)) {
|
168
|
+
valueType = 'element';
|
169
|
+
} else {
|
170
|
+
valueType = toType(value);
|
171
|
+
}
|
172
|
+
|
173
|
+
if (!new RegExp(expectedTypes).test(valueType)) {
|
174
|
+
throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
}
|
179
|
+
};
|
180
|
+
|
181
|
+
setTransitionEndSupport();
|
182
|
+
|
183
|
+
return Util;
|
184
|
+
})(jQuery);
|
185
|
+
|
186
|
+
/**
|
187
|
+
* --------------------------------------------------------------------------
|
188
|
+
* Bootstrap (v4.0.0): alert.js
|
189
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
190
|
+
* --------------------------------------------------------------------------
|
191
|
+
*/
|
192
|
+
|
193
|
+
var Alert = (function ($) {
|
194
|
+
|
195
|
+
/**
|
196
|
+
* ------------------------------------------------------------------------
|
197
|
+
* Constants
|
198
|
+
* ------------------------------------------------------------------------
|
199
|
+
*/
|
200
|
+
|
201
|
+
var NAME = 'alert';
|
202
|
+
var VERSION = '4.0.0';
|
203
|
+
var DATA_KEY = 'bs.alert';
|
204
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
205
|
+
var DATA_API_KEY = '.data-api';
|
206
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
207
|
+
var TRANSITION_DURATION = 150;
|
208
|
+
|
209
|
+
var Selector = {
|
210
|
+
DISMISS: '[data-dismiss="alert"]'
|
211
|
+
};
|
212
|
+
|
213
|
+
var Event = {
|
214
|
+
CLOSE: 'close' + EVENT_KEY,
|
215
|
+
CLOSED: 'closed' + EVENT_KEY,
|
216
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
217
|
+
};
|
218
|
+
|
219
|
+
var ClassName = {
|
220
|
+
ALERT: 'alert',
|
221
|
+
FADE: 'fade',
|
222
|
+
IN: 'in'
|
223
|
+
};
|
224
|
+
|
225
|
+
/**
|
226
|
+
* ------------------------------------------------------------------------
|
227
|
+
* Class Definition
|
228
|
+
* ------------------------------------------------------------------------
|
229
|
+
*/
|
230
|
+
|
231
|
+
var Alert = (function () {
|
232
|
+
function Alert(element) {
|
233
|
+
_classCallCheck(this, Alert);
|
234
|
+
|
235
|
+
this._element = element;
|
236
|
+
}
|
237
|
+
|
238
|
+
/**
|
239
|
+
* ------------------------------------------------------------------------
|
240
|
+
* Data Api implementation
|
241
|
+
* ------------------------------------------------------------------------
|
242
|
+
*/
|
243
|
+
|
244
|
+
// getters
|
245
|
+
|
246
|
+
_createClass(Alert, [{
|
247
|
+
key: 'close',
|
248
|
+
|
249
|
+
// public
|
250
|
+
|
251
|
+
value: function close(element) {
|
252
|
+
element = element || this._element;
|
253
|
+
|
254
|
+
var rootElement = this._getRootElement(element);
|
255
|
+
var customEvent = this._triggerCloseEvent(rootElement);
|
256
|
+
|
257
|
+
if (customEvent.isDefaultPrevented()) {
|
258
|
+
return;
|
259
|
+
}
|
260
|
+
|
261
|
+
this._removeElement(rootElement);
|
262
|
+
}
|
263
|
+
}, {
|
264
|
+
key: 'dispose',
|
265
|
+
value: function dispose() {
|
266
|
+
$.removeData(this._element, DATA_KEY);
|
267
|
+
this._element = null;
|
268
|
+
}
|
269
|
+
|
270
|
+
// private
|
271
|
+
|
272
|
+
}, {
|
273
|
+
key: '_getRootElement',
|
274
|
+
value: function _getRootElement(element) {
|
275
|
+
var selector = Util.getSelectorFromElement(element);
|
276
|
+
var parent = false;
|
277
|
+
|
278
|
+
if (selector) {
|
279
|
+
parent = $(selector)[0];
|
280
|
+
}
|
281
|
+
|
282
|
+
if (!parent) {
|
283
|
+
parent = $(element).closest('.' + ClassName.ALERT)[0];
|
284
|
+
}
|
285
|
+
|
286
|
+
return parent;
|
287
|
+
}
|
288
|
+
}, {
|
289
|
+
key: '_triggerCloseEvent',
|
290
|
+
value: function _triggerCloseEvent(element) {
|
291
|
+
var closeEvent = $.Event(Event.CLOSE);
|
292
|
+
|
293
|
+
$(element).trigger(closeEvent);
|
294
|
+
return closeEvent;
|
295
|
+
}
|
296
|
+
}, {
|
297
|
+
key: '_removeElement',
|
298
|
+
value: function _removeElement(element) {
|
299
|
+
$(element).removeClass(ClassName.IN);
|
300
|
+
|
301
|
+
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
|
302
|
+
this._destroyElement(element);
|
303
|
+
return;
|
304
|
+
}
|
305
|
+
|
306
|
+
$(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
|
307
|
+
}
|
308
|
+
}, {
|
309
|
+
key: '_destroyElement',
|
310
|
+
value: function _destroyElement(element) {
|
311
|
+
$(element).detach().trigger(Event.CLOSED).remove();
|
312
|
+
}
|
313
|
+
|
314
|
+
// static
|
315
|
+
|
316
|
+
}], [{
|
317
|
+
key: '_jQueryInterface',
|
318
|
+
value: function _jQueryInterface(config) {
|
319
|
+
return this.each(function () {
|
320
|
+
var $element = $(this);
|
321
|
+
var data = $element.data(DATA_KEY);
|
322
|
+
|
323
|
+
if (!data) {
|
324
|
+
data = new Alert(this);
|
325
|
+
$element.data(DATA_KEY, data);
|
326
|
+
}
|
327
|
+
|
328
|
+
if (config === 'close') {
|
329
|
+
data[config](this);
|
330
|
+
}
|
331
|
+
});
|
332
|
+
}
|
333
|
+
}, {
|
334
|
+
key: '_handleDismiss',
|
335
|
+
value: function _handleDismiss(alertInstance) {
|
336
|
+
return function (event) {
|
337
|
+
if (event) {
|
338
|
+
event.preventDefault();
|
339
|
+
}
|
340
|
+
|
341
|
+
alertInstance.close(this);
|
342
|
+
};
|
343
|
+
}
|
344
|
+
}, {
|
345
|
+
key: 'VERSION',
|
346
|
+
get: function get() {
|
347
|
+
return VERSION;
|
348
|
+
}
|
349
|
+
}]);
|
350
|
+
|
351
|
+
return Alert;
|
352
|
+
})();
|
353
|
+
|
354
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
355
|
+
|
356
|
+
/**
|
357
|
+
* ------------------------------------------------------------------------
|
358
|
+
* jQuery
|
359
|
+
* ------------------------------------------------------------------------
|
360
|
+
*/
|
361
|
+
|
362
|
+
$.fn[NAME] = Alert._jQueryInterface;
|
363
|
+
$.fn[NAME].Constructor = Alert;
|
364
|
+
$.fn[NAME].noConflict = function () {
|
365
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
366
|
+
return Alert._jQueryInterface;
|
367
|
+
};
|
368
|
+
|
369
|
+
return Alert;
|
370
|
+
})(jQuery);
|
371
|
+
|
372
|
+
/**
|
373
|
+
* --------------------------------------------------------------------------
|
374
|
+
* Bootstrap (v4.0.0): button.js
|
375
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
376
|
+
* --------------------------------------------------------------------------
|
377
|
+
*/
|
378
|
+
|
379
|
+
var Button = (function ($) {
|
380
|
+
|
381
|
+
/**
|
382
|
+
* ------------------------------------------------------------------------
|
383
|
+
* Constants
|
384
|
+
* ------------------------------------------------------------------------
|
385
|
+
*/
|
386
|
+
|
387
|
+
var NAME = 'button';
|
388
|
+
var VERSION = '4.0.0';
|
389
|
+
var DATA_KEY = 'bs.button';
|
390
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
391
|
+
var DATA_API_KEY = '.data-api';
|
392
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
393
|
+
|
394
|
+
var ClassName = {
|
395
|
+
ACTIVE: 'active',
|
396
|
+
BUTTON: 'btn',
|
397
|
+
FOCUS: 'focus'
|
398
|
+
};
|
399
|
+
|
400
|
+
var Selector = {
|
401
|
+
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
402
|
+
DATA_TOGGLE: '[data-toggle="buttons"]',
|
403
|
+
INPUT: 'input',
|
404
|
+
ACTIVE: '.active',
|
405
|
+
BUTTON: '.btn'
|
406
|
+
};
|
407
|
+
|
408
|
+
var Event = {
|
409
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
410
|
+
FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
|
411
|
+
};
|
412
|
+
|
413
|
+
/**
|
414
|
+
* ------------------------------------------------------------------------
|
415
|
+
* Class Definition
|
416
|
+
* ------------------------------------------------------------------------
|
417
|
+
*/
|
418
|
+
|
419
|
+
var Button = (function () {
|
420
|
+
function Button(element) {
|
421
|
+
_classCallCheck(this, Button);
|
422
|
+
|
423
|
+
this._element = element;
|
424
|
+
}
|
425
|
+
|
426
|
+
/**
|
427
|
+
* ------------------------------------------------------------------------
|
428
|
+
* Data Api implementation
|
429
|
+
* ------------------------------------------------------------------------
|
430
|
+
*/
|
431
|
+
|
432
|
+
// getters
|
433
|
+
|
434
|
+
_createClass(Button, [{
|
435
|
+
key: 'toggle',
|
436
|
+
|
437
|
+
// public
|
438
|
+
|
439
|
+
value: function toggle() {
|
440
|
+
var triggerChangeEvent = true;
|
441
|
+
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
442
|
+
|
443
|
+
if (rootElement) {
|
444
|
+
var input = $(this._element).find(Selector.INPUT)[0];
|
445
|
+
|
446
|
+
if (input) {
|
447
|
+
if (input.type === 'radio') {
|
448
|
+
if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
|
449
|
+
triggerChangeEvent = false;
|
450
|
+
} else {
|
451
|
+
var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
|
452
|
+
|
453
|
+
if (activeElement) {
|
454
|
+
$(activeElement).removeClass(ClassName.ACTIVE);
|
455
|
+
}
|
456
|
+
}
|
457
|
+
}
|
458
|
+
|
459
|
+
if (triggerChangeEvent) {
|
460
|
+
input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
|
461
|
+
$(this._element).trigger('change');
|
462
|
+
}
|
463
|
+
}
|
464
|
+
} else {
|
465
|
+
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
|
466
|
+
}
|
467
|
+
|
468
|
+
if (triggerChangeEvent) {
|
469
|
+
$(this._element).toggleClass(ClassName.ACTIVE);
|
470
|
+
}
|
471
|
+
}
|
472
|
+
}, {
|
473
|
+
key: 'dispose',
|
474
|
+
value: function dispose() {
|
475
|
+
$.removeData(this._element, DATA_KEY);
|
476
|
+
this._element = null;
|
477
|
+
}
|
478
|
+
|
479
|
+
// static
|
480
|
+
|
481
|
+
}], [{
|
482
|
+
key: '_jQueryInterface',
|
483
|
+
value: function _jQueryInterface(config) {
|
484
|
+
return this.each(function () {
|
485
|
+
var data = $(this).data(DATA_KEY);
|
486
|
+
|
487
|
+
if (!data) {
|
488
|
+
data = new Button(this);
|
489
|
+
$(this).data(DATA_KEY, data);
|
490
|
+
}
|
491
|
+
|
492
|
+
if (config === 'toggle') {
|
493
|
+
data[config]();
|
494
|
+
}
|
495
|
+
});
|
496
|
+
}
|
497
|
+
}, {
|
498
|
+
key: 'VERSION',
|
499
|
+
get: function get() {
|
500
|
+
return VERSION;
|
501
|
+
}
|
502
|
+
}]);
|
503
|
+
|
504
|
+
return Button;
|
505
|
+
})();
|
506
|
+
|
507
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
508
|
+
event.preventDefault();
|
509
|
+
|
510
|
+
var button = event.target;
|
511
|
+
|
512
|
+
if (!$(button).hasClass(ClassName.BUTTON)) {
|
513
|
+
button = $(button).closest(Selector.BUTTON);
|
514
|
+
}
|
515
|
+
|
516
|
+
Button._jQueryInterface.call($(button), 'toggle');
|
517
|
+
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
518
|
+
var button = $(event.target).closest(Selector.BUTTON)[0];
|
519
|
+
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
520
|
+
});
|
521
|
+
|
522
|
+
/**
|
523
|
+
* ------------------------------------------------------------------------
|
524
|
+
* jQuery
|
525
|
+
* ------------------------------------------------------------------------
|
526
|
+
*/
|
527
|
+
|
528
|
+
$.fn[NAME] = Button._jQueryInterface;
|
529
|
+
$.fn[NAME].Constructor = Button;
|
530
|
+
$.fn[NAME].noConflict = function () {
|
531
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
532
|
+
return Button._jQueryInterface;
|
533
|
+
};
|
534
|
+
|
535
|
+
return Button;
|
536
|
+
})(jQuery);
|
537
|
+
|
538
|
+
/**
|
539
|
+
* --------------------------------------------------------------------------
|
540
|
+
* Bootstrap (v4.0.0): carousel.js
|
541
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
542
|
+
* --------------------------------------------------------------------------
|
543
|
+
*/
|
544
|
+
|
545
|
+
var Carousel = (function ($) {
|
546
|
+
|
547
|
+
/**
|
548
|
+
* ------------------------------------------------------------------------
|
549
|
+
* Constants
|
550
|
+
* ------------------------------------------------------------------------
|
551
|
+
*/
|
552
|
+
|
553
|
+
var NAME = 'carousel';
|
554
|
+
var VERSION = '4.0.0';
|
555
|
+
var DATA_KEY = 'bs.carousel';
|
556
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
557
|
+
var DATA_API_KEY = '.data-api';
|
558
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
559
|
+
var TRANSITION_DURATION = 600;
|
560
|
+
|
561
|
+
var Default = {
|
562
|
+
interval: 5000,
|
563
|
+
keyboard: true,
|
564
|
+
slide: false,
|
565
|
+
pause: 'hover',
|
566
|
+
wrap: true
|
567
|
+
};
|
568
|
+
|
569
|
+
var DefaultType = {
|
570
|
+
interval: '(number|boolean)',
|
571
|
+
keyboard: 'boolean',
|
572
|
+
slide: '(boolean|string)',
|
573
|
+
pause: '(string|boolean)',
|
574
|
+
wrap: 'boolean'
|
575
|
+
};
|
576
|
+
|
577
|
+
var Direction = {
|
578
|
+
NEXT: 'next',
|
579
|
+
PREVIOUS: 'prev'
|
580
|
+
};
|
581
|
+
|
582
|
+
var Event = {
|
583
|
+
SLIDE: 'slide' + EVENT_KEY,
|
584
|
+
SLID: 'slid' + EVENT_KEY,
|
585
|
+
KEYDOWN: 'keydown' + EVENT_KEY,
|
586
|
+
MOUSEENTER: 'mouseenter' + EVENT_KEY,
|
587
|
+
MOUSELEAVE: 'mouseleave' + EVENT_KEY,
|
588
|
+
LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
|
589
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
590
|
+
};
|
591
|
+
|
592
|
+
var ClassName = {
|
593
|
+
CAROUSEL: 'carousel',
|
594
|
+
ACTIVE: 'active',
|
595
|
+
SLIDE: 'slide',
|
596
|
+
RIGHT: 'right',
|
597
|
+
LEFT: 'left',
|
598
|
+
ITEM: 'carousel-item'
|
599
|
+
};
|
600
|
+
|
601
|
+
var Selector = {
|
602
|
+
ACTIVE: '.active',
|
603
|
+
ACTIVE_ITEM: '.active.carousel-item',
|
604
|
+
ITEM: '.carousel-item',
|
605
|
+
NEXT_PREV: '.next, .prev',
|
606
|
+
INDICATORS: '.carousel-indicators',
|
607
|
+
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
608
|
+
DATA_RIDE: '[data-ride="carousel"]'
|
609
|
+
};
|
610
|
+
|
611
|
+
/**
|
612
|
+
* ------------------------------------------------------------------------
|
613
|
+
* Class Definition
|
614
|
+
* ------------------------------------------------------------------------
|
615
|
+
*/
|
616
|
+
|
617
|
+
var Carousel = (function () {
|
618
|
+
function Carousel(element, config) {
|
619
|
+
_classCallCheck(this, Carousel);
|
620
|
+
|
621
|
+
this._items = null;
|
622
|
+
this._interval = null;
|
623
|
+
this._activeElement = null;
|
624
|
+
|
625
|
+
this._isPaused = false;
|
626
|
+
this._isSliding = false;
|
627
|
+
|
628
|
+
this._config = this._getConfig(config);
|
629
|
+
this._element = $(element)[0];
|
630
|
+
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
|
631
|
+
|
632
|
+
this._addEventListeners();
|
633
|
+
}
|
634
|
+
|
635
|
+
/**
|
636
|
+
* ------------------------------------------------------------------------
|
637
|
+
* Data Api implementation
|
638
|
+
* ------------------------------------------------------------------------
|
639
|
+
*/
|
640
|
+
|
641
|
+
// getters
|
642
|
+
|
643
|
+
_createClass(Carousel, [{
|
644
|
+
key: 'next',
|
645
|
+
|
646
|
+
// public
|
647
|
+
|
648
|
+
value: function next() {
|
649
|
+
if (!this._isSliding) {
|
650
|
+
this._slide(Direction.NEXT);
|
651
|
+
}
|
652
|
+
}
|
653
|
+
}, {
|
654
|
+
key: 'prev',
|
655
|
+
value: function prev() {
|
656
|
+
if (!this._isSliding) {
|
657
|
+
this._slide(Direction.PREVIOUS);
|
658
|
+
}
|
659
|
+
}
|
660
|
+
}, {
|
661
|
+
key: 'pause',
|
662
|
+
value: function pause(event) {
|
663
|
+
if (!event) {
|
664
|
+
this._isPaused = true;
|
665
|
+
}
|
666
|
+
|
667
|
+
if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
|
668
|
+
Util.triggerTransitionEnd(this._element);
|
669
|
+
this.cycle(true);
|
670
|
+
}
|
671
|
+
|
672
|
+
clearInterval(this._interval);
|
673
|
+
this._interval = null;
|
674
|
+
}
|
675
|
+
}, {
|
676
|
+
key: 'cycle',
|
677
|
+
value: function cycle(event) {
|
678
|
+
if (!event) {
|
679
|
+
this._isPaused = false;
|
680
|
+
}
|
681
|
+
|
682
|
+
if (this._interval) {
|
683
|
+
clearInterval(this._interval);
|
684
|
+
this._interval = null;
|
685
|
+
}
|
686
|
+
|
687
|
+
if (this._config.interval && !this._isPaused) {
|
688
|
+
this._interval = setInterval($.proxy(this.next, this), this._config.interval);
|
689
|
+
}
|
690
|
+
}
|
691
|
+
}, {
|
692
|
+
key: 'to',
|
693
|
+
value: function to(index) {
|
694
|
+
var _this2 = this;
|
695
|
+
|
696
|
+
this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
697
|
+
|
698
|
+
var activeIndex = this._getItemIndex(this._activeElement);
|
699
|
+
|
700
|
+
if (index > this._items.length - 1 || index < 0) {
|
701
|
+
return;
|
702
|
+
}
|
703
|
+
|
704
|
+
if (this._isSliding) {
|
705
|
+
$(this._element).one(Event.SLID, function () {
|
706
|
+
return _this2.to(index);
|
707
|
+
});
|
708
|
+
return;
|
709
|
+
}
|
710
|
+
|
711
|
+
if (activeIndex === index) {
|
712
|
+
this.pause();
|
713
|
+
this.cycle();
|
714
|
+
return;
|
715
|
+
}
|
716
|
+
|
717
|
+
var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
|
718
|
+
|
719
|
+
this._slide(direction, this._items[index]);
|
720
|
+
}
|
721
|
+
}, {
|
722
|
+
key: 'dispose',
|
723
|
+
value: function dispose() {
|
724
|
+
$(this._element).off(EVENT_KEY);
|
725
|
+
$.removeData(this._element, DATA_KEY);
|
726
|
+
|
727
|
+
this._items = null;
|
728
|
+
this._config = null;
|
729
|
+
this._element = null;
|
730
|
+
this._interval = null;
|
731
|
+
this._isPaused = null;
|
732
|
+
this._isSliding = null;
|
733
|
+
this._activeElement = null;
|
734
|
+
this._indicatorsElement = null;
|
735
|
+
}
|
736
|
+
|
737
|
+
// private
|
738
|
+
|
739
|
+
}, {
|
740
|
+
key: '_getConfig',
|
741
|
+
value: function _getConfig(config) {
|
742
|
+
config = $.extend({}, Default, config);
|
743
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
744
|
+
return config;
|
745
|
+
}
|
746
|
+
}, {
|
747
|
+
key: '_addEventListeners',
|
748
|
+
value: function _addEventListeners() {
|
749
|
+
if (this._config.keyboard) {
|
750
|
+
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
|
751
|
+
}
|
752
|
+
|
753
|
+
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
|
754
|
+
$(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
|
755
|
+
}
|
756
|
+
}
|
757
|
+
}, {
|
758
|
+
key: '_keydown',
|
759
|
+
value: function _keydown(event) {
|
760
|
+
event.preventDefault();
|
761
|
+
|
762
|
+
if (/input|textarea/i.test(event.target.tagName)) {
|
763
|
+
return;
|
764
|
+
}
|
765
|
+
|
766
|
+
switch (event.which) {
|
767
|
+
case 37:
|
768
|
+
this.prev();break;
|
769
|
+
case 39:
|
770
|
+
this.next();break;
|
771
|
+
default:
|
772
|
+
return;
|
773
|
+
}
|
774
|
+
}
|
775
|
+
}, {
|
776
|
+
key: '_getItemIndex',
|
777
|
+
value: function _getItemIndex(element) {
|
778
|
+
this._items = $.makeArray($(element).parent().find(Selector.ITEM));
|
779
|
+
return this._items.indexOf(element);
|
780
|
+
}
|
781
|
+
}, {
|
782
|
+
key: '_getItemByDirection',
|
783
|
+
value: function _getItemByDirection(direction, activeElement) {
|
784
|
+
var isNextDirection = direction === Direction.NEXT;
|
785
|
+
var isPrevDirection = direction === Direction.PREVIOUS;
|
786
|
+
var activeIndex = this._getItemIndex(activeElement);
|
787
|
+
var lastItemIndex = this._items.length - 1;
|
788
|
+
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
789
|
+
|
790
|
+
if (isGoingToWrap && !this._config.wrap) {
|
791
|
+
return activeElement;
|
792
|
+
}
|
793
|
+
|
794
|
+
var delta = direction === Direction.PREVIOUS ? -1 : 1;
|
795
|
+
var itemIndex = (activeIndex + delta) % this._items.length;
|
796
|
+
|
797
|
+
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
798
|
+
}
|
799
|
+
}, {
|
800
|
+
key: '_triggerSlideEvent',
|
801
|
+
value: function _triggerSlideEvent(relatedTarget, directionalClassname) {
|
802
|
+
var slideEvent = $.Event(Event.SLIDE, {
|
803
|
+
relatedTarget: relatedTarget,
|
804
|
+
direction: directionalClassname
|
805
|
+
});
|
806
|
+
|
807
|
+
$(this._element).trigger(slideEvent);
|
808
|
+
|
809
|
+
return slideEvent;
|
810
|
+
}
|
811
|
+
}, {
|
812
|
+
key: '_setActiveIndicatorElement',
|
813
|
+
value: function _setActiveIndicatorElement(element) {
|
814
|
+
if (this._indicatorsElement) {
|
815
|
+
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
816
|
+
|
817
|
+
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
818
|
+
|
819
|
+
if (nextIndicator) {
|
820
|
+
$(nextIndicator).addClass(ClassName.ACTIVE);
|
821
|
+
}
|
822
|
+
}
|
823
|
+
}
|
824
|
+
}, {
|
825
|
+
key: '_slide',
|
826
|
+
value: function _slide(direction, element) {
|
827
|
+
var _this3 = this;
|
828
|
+
|
829
|
+
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
830
|
+
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
831
|
+
|
832
|
+
var isCycling = Boolean(this._interval);
|
833
|
+
|
834
|
+
var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
|
835
|
+
|
836
|
+
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
837
|
+
this._isSliding = false;
|
838
|
+
return;
|
839
|
+
}
|
840
|
+
|
841
|
+
var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
|
842
|
+
if (slideEvent.isDefaultPrevented()) {
|
843
|
+
return;
|
844
|
+
}
|
845
|
+
|
846
|
+
if (!activeElement || !nextElement) {
|
847
|
+
// some weirdness is happening, so we bail
|
848
|
+
return;
|
849
|
+
}
|
850
|
+
|
851
|
+
this._isSliding = true;
|
852
|
+
|
853
|
+
if (isCycling) {
|
854
|
+
this.pause();
|
855
|
+
}
|
856
|
+
|
857
|
+
this._setActiveIndicatorElement(nextElement);
|
858
|
+
|
859
|
+
var slidEvent = $.Event(Event.SLID, {
|
860
|
+
relatedTarget: nextElement,
|
861
|
+
direction: directionalClassName
|
862
|
+
});
|
863
|
+
|
864
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
|
865
|
+
|
866
|
+
$(nextElement).addClass(direction);
|
867
|
+
|
868
|
+
Util.reflow(nextElement);
|
869
|
+
|
870
|
+
$(activeElement).addClass(directionalClassName);
|
871
|
+
$(nextElement).addClass(directionalClassName);
|
872
|
+
|
873
|
+
$(activeElement).one(Util.TRANSITION_END, function () {
|
874
|
+
$(nextElement).removeClass(directionalClassName).removeClass(direction);
|
875
|
+
|
876
|
+
$(nextElement).addClass(ClassName.ACTIVE);
|
877
|
+
|
878
|
+
$(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
|
879
|
+
|
880
|
+
_this3._isSliding = false;
|
881
|
+
|
882
|
+
setTimeout(function () {
|
883
|
+
return $(_this3._element).trigger(slidEvent);
|
884
|
+
}, 0);
|
885
|
+
}).emulateTransitionEnd(TRANSITION_DURATION);
|
886
|
+
} else {
|
887
|
+
$(activeElement).removeClass(ClassName.ACTIVE);
|
888
|
+
$(nextElement).addClass(ClassName.ACTIVE);
|
889
|
+
|
890
|
+
this._isSliding = false;
|
891
|
+
$(this._element).trigger(slidEvent);
|
892
|
+
}
|
893
|
+
|
894
|
+
if (isCycling) {
|
895
|
+
this.cycle();
|
896
|
+
}
|
897
|
+
}
|
898
|
+
|
899
|
+
// static
|
900
|
+
|
901
|
+
}], [{
|
902
|
+
key: '_jQueryInterface',
|
903
|
+
value: function _jQueryInterface(config) {
|
904
|
+
return this.each(function () {
|
905
|
+
var data = $(this).data(DATA_KEY);
|
906
|
+
var _config = $.extend({}, Default, $(this).data());
|
907
|
+
|
908
|
+
if (typeof config === 'object') {
|
909
|
+
$.extend(_config, config);
|
910
|
+
}
|
911
|
+
|
912
|
+
var action = typeof config === 'string' ? config : _config.slide;
|
913
|
+
|
914
|
+
if (!data) {
|
915
|
+
data = new Carousel(this, _config);
|
916
|
+
$(this).data(DATA_KEY, data);
|
917
|
+
}
|
918
|
+
|
919
|
+
if (typeof config === 'number') {
|
920
|
+
data.to(config);
|
921
|
+
} else if (action) {
|
922
|
+
data[action]();
|
923
|
+
} else if (_config.interval) {
|
924
|
+
data.pause();
|
925
|
+
data.cycle();
|
926
|
+
}
|
927
|
+
});
|
928
|
+
}
|
929
|
+
}, {
|
930
|
+
key: '_dataApiClickHandler',
|
931
|
+
value: function _dataApiClickHandler(event) {
|
932
|
+
var selector = Util.getSelectorFromElement(this);
|
933
|
+
|
934
|
+
if (!selector) {
|
935
|
+
return;
|
936
|
+
}
|
937
|
+
|
938
|
+
var target = $(selector)[0];
|
939
|
+
|
940
|
+
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
941
|
+
return;
|
942
|
+
}
|
943
|
+
|
944
|
+
var config = $.extend({}, $(target).data(), $(this).data());
|
945
|
+
var slideIndex = this.getAttribute('data-slide-to');
|
946
|
+
|
947
|
+
if (slideIndex) {
|
948
|
+
config.interval = false;
|
949
|
+
}
|
950
|
+
|
951
|
+
Carousel._jQueryInterface.call($(target), config);
|
952
|
+
|
953
|
+
if (slideIndex) {
|
954
|
+
$(target).data(DATA_KEY).to(slideIndex);
|
955
|
+
}
|
956
|
+
|
957
|
+
event.preventDefault();
|
958
|
+
}
|
959
|
+
}, {
|
960
|
+
key: 'VERSION',
|
961
|
+
get: function get() {
|
962
|
+
return VERSION;
|
963
|
+
}
|
964
|
+
}, {
|
965
|
+
key: 'Default',
|
966
|
+
get: function get() {
|
967
|
+
return Default;
|
968
|
+
}
|
969
|
+
}]);
|
970
|
+
|
971
|
+
return Carousel;
|
972
|
+
})();
|
973
|
+
|
974
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
975
|
+
|
976
|
+
$(window).on(Event.LOAD_DATA_API, function () {
|
977
|
+
$(Selector.DATA_RIDE).each(function () {
|
978
|
+
var $carousel = $(this);
|
979
|
+
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
980
|
+
});
|
981
|
+
});
|
982
|
+
|
983
|
+
/**
|
984
|
+
* ------------------------------------------------------------------------
|
985
|
+
* jQuery
|
986
|
+
* ------------------------------------------------------------------------
|
987
|
+
*/
|
988
|
+
|
989
|
+
$.fn[NAME] = Carousel._jQueryInterface;
|
990
|
+
$.fn[NAME].Constructor = Carousel;
|
991
|
+
$.fn[NAME].noConflict = function () {
|
992
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
993
|
+
return Carousel._jQueryInterface;
|
994
|
+
};
|
995
|
+
|
996
|
+
return Carousel;
|
997
|
+
})(jQuery);
|
998
|
+
|
999
|
+
/**
|
1000
|
+
* --------------------------------------------------------------------------
|
1001
|
+
* Bootstrap (v4.0.0): collapse.js
|
1002
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1003
|
+
* --------------------------------------------------------------------------
|
1004
|
+
*/
|
1005
|
+
|
1006
|
+
var Collapse = (function ($) {
|
1007
|
+
|
1008
|
+
/**
|
1009
|
+
* ------------------------------------------------------------------------
|
1010
|
+
* Constants
|
1011
|
+
* ------------------------------------------------------------------------
|
1012
|
+
*/
|
1013
|
+
|
1014
|
+
var NAME = 'collapse';
|
1015
|
+
var VERSION = '4.0.0';
|
1016
|
+
var DATA_KEY = 'bs.collapse';
|
1017
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
1018
|
+
var DATA_API_KEY = '.data-api';
|
1019
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
1020
|
+
var TRANSITION_DURATION = 600;
|
1021
|
+
|
1022
|
+
var Default = {
|
1023
|
+
toggle: true,
|
1024
|
+
parent: ''
|
1025
|
+
};
|
1026
|
+
|
1027
|
+
var DefaultType = {
|
1028
|
+
toggle: 'boolean',
|
1029
|
+
parent: 'string'
|
1030
|
+
};
|
1031
|
+
|
1032
|
+
var Event = {
|
1033
|
+
SHOW: 'show' + EVENT_KEY,
|
1034
|
+
SHOWN: 'shown' + EVENT_KEY,
|
1035
|
+
HIDE: 'hide' + EVENT_KEY,
|
1036
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
1037
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
1038
|
+
};
|
1039
|
+
|
1040
|
+
var ClassName = {
|
1041
|
+
IN: 'in',
|
1042
|
+
COLLAPSE: 'collapse',
|
1043
|
+
COLLAPSING: 'collapsing',
|
1044
|
+
COLLAPSED: 'collapsed'
|
1045
|
+
};
|
1046
|
+
|
1047
|
+
var Dimension = {
|
1048
|
+
WIDTH: 'width',
|
1049
|
+
HEIGHT: 'height'
|
1050
|
+
};
|
1051
|
+
|
1052
|
+
var Selector = {
|
1053
|
+
ACTIVES: '.panel > .in, .panel > .collapsing',
|
1054
|
+
DATA_TOGGLE: '[data-toggle="collapse"]'
|
1055
|
+
};
|
1056
|
+
|
1057
|
+
/**
|
1058
|
+
* ------------------------------------------------------------------------
|
1059
|
+
* Class Definition
|
1060
|
+
* ------------------------------------------------------------------------
|
1061
|
+
*/
|
1062
|
+
|
1063
|
+
var Collapse = (function () {
|
1064
|
+
function Collapse(element, config) {
|
1065
|
+
_classCallCheck(this, Collapse);
|
1066
|
+
|
1067
|
+
this._isTransitioning = false;
|
1068
|
+
this._element = element;
|
1069
|
+
this._config = this._getConfig(config);
|
1070
|
+
this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
|
1071
|
+
|
1072
|
+
this._parent = this._config.parent ? this._getParent() : null;
|
1073
|
+
|
1074
|
+
if (!this._config.parent) {
|
1075
|
+
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
if (this._config.toggle) {
|
1079
|
+
this.toggle();
|
1080
|
+
}
|
1081
|
+
}
|
1082
|
+
|
1083
|
+
/**
|
1084
|
+
* ------------------------------------------------------------------------
|
1085
|
+
* Data Api implementation
|
1086
|
+
* ------------------------------------------------------------------------
|
1087
|
+
*/
|
1088
|
+
|
1089
|
+
// getters
|
1090
|
+
|
1091
|
+
_createClass(Collapse, [{
|
1092
|
+
key: 'toggle',
|
1093
|
+
|
1094
|
+
// public
|
1095
|
+
|
1096
|
+
value: function toggle() {
|
1097
|
+
if ($(this._element).hasClass(ClassName.IN)) {
|
1098
|
+
this.hide();
|
1099
|
+
} else {
|
1100
|
+
this.show();
|
1101
|
+
}
|
1102
|
+
}
|
1103
|
+
}, {
|
1104
|
+
key: 'show',
|
1105
|
+
value: function show() {
|
1106
|
+
var _this4 = this;
|
1107
|
+
|
1108
|
+
if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
|
1109
|
+
return;
|
1110
|
+
}
|
1111
|
+
|
1112
|
+
var actives = undefined;
|
1113
|
+
var activesData = undefined;
|
1114
|
+
|
1115
|
+
if (this._parent) {
|
1116
|
+
actives = $.makeArray($(Selector.ACTIVES));
|
1117
|
+
if (!actives.length) {
|
1118
|
+
actives = null;
|
1119
|
+
}
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
if (actives) {
|
1123
|
+
activesData = $(actives).data(DATA_KEY);
|
1124
|
+
if (activesData && activesData._isTransitioning) {
|
1125
|
+
return;
|
1126
|
+
}
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
var startEvent = $.Event(Event.SHOW);
|
1130
|
+
$(this._element).trigger(startEvent);
|
1131
|
+
if (startEvent.isDefaultPrevented()) {
|
1132
|
+
return;
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
if (actives) {
|
1136
|
+
Collapse._jQueryInterface.call($(actives), 'hide');
|
1137
|
+
if (!activesData) {
|
1138
|
+
$(actives).data(DATA_KEY, null);
|
1139
|
+
}
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
var dimension = this._getDimension();
|
1143
|
+
|
1144
|
+
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
1145
|
+
|
1146
|
+
this._element.style[dimension] = 0;
|
1147
|
+
this._element.setAttribute('aria-expanded', true);
|
1148
|
+
|
1149
|
+
if (this._triggerArray.length) {
|
1150
|
+
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
this.setTransitioning(true);
|
1154
|
+
|
1155
|
+
var complete = function complete() {
|
1156
|
+
$(_this4._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
|
1157
|
+
|
1158
|
+
_this4._element.style[dimension] = '';
|
1159
|
+
|
1160
|
+
_this4.setTransitioning(false);
|
1161
|
+
|
1162
|
+
$(_this4._element).trigger(Event.SHOWN);
|
1163
|
+
};
|
1164
|
+
|
1165
|
+
if (!Util.supportsTransitionEnd()) {
|
1166
|
+
complete();
|
1167
|
+
return;
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
1171
|
+
var scrollSize = 'scroll' + capitalizedDimension;
|
1172
|
+
|
1173
|
+
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
1174
|
+
|
1175
|
+
this._element.style[dimension] = this._element[scrollSize] + 'px';
|
1176
|
+
}
|
1177
|
+
}, {
|
1178
|
+
key: 'hide',
|
1179
|
+
value: function hide() {
|
1180
|
+
var _this5 = this;
|
1181
|
+
|
1182
|
+
if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
|
1183
|
+
return;
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
var startEvent = $.Event(Event.HIDE);
|
1187
|
+
$(this._element).trigger(startEvent);
|
1188
|
+
if (startEvent.isDefaultPrevented()) {
|
1189
|
+
return;
|
1190
|
+
}
|
1191
|
+
|
1192
|
+
var dimension = this._getDimension();
|
1193
|
+
var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
|
1194
|
+
|
1195
|
+
this._element.style[dimension] = this._element[offsetDimension] + 'px';
|
1196
|
+
|
1197
|
+
Util.reflow(this._element);
|
1198
|
+
|
1199
|
+
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
|
1200
|
+
|
1201
|
+
this._element.setAttribute('aria-expanded', false);
|
1202
|
+
|
1203
|
+
if (this._triggerArray.length) {
|
1204
|
+
$(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
1205
|
+
}
|
1206
|
+
|
1207
|
+
this.setTransitioning(true);
|
1208
|
+
|
1209
|
+
var complete = function complete() {
|
1210
|
+
_this5.setTransitioning(false);
|
1211
|
+
$(_this5._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
1212
|
+
};
|
1213
|
+
|
1214
|
+
this._element.style[dimension] = 0;
|
1215
|
+
|
1216
|
+
if (!Util.supportsTransitionEnd()) {
|
1217
|
+
complete();
|
1218
|
+
return;
|
1219
|
+
}
|
1220
|
+
|
1221
|
+
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
1222
|
+
}
|
1223
|
+
}, {
|
1224
|
+
key: 'setTransitioning',
|
1225
|
+
value: function setTransitioning(isTransitioning) {
|
1226
|
+
this._isTransitioning = isTransitioning;
|
1227
|
+
}
|
1228
|
+
}, {
|
1229
|
+
key: 'dispose',
|
1230
|
+
value: function dispose() {
|
1231
|
+
$.removeData(this._element, DATA_KEY);
|
1232
|
+
|
1233
|
+
this._config = null;
|
1234
|
+
this._parent = null;
|
1235
|
+
this._element = null;
|
1236
|
+
this._triggerArray = null;
|
1237
|
+
this._isTransitioning = null;
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
// private
|
1241
|
+
|
1242
|
+
}, {
|
1243
|
+
key: '_getConfig',
|
1244
|
+
value: function _getConfig(config) {
|
1245
|
+
config = $.extend({}, Default, config);
|
1246
|
+
config.toggle = Boolean(config.toggle); // coerce string values
|
1247
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
1248
|
+
return config;
|
1249
|
+
}
|
1250
|
+
}, {
|
1251
|
+
key: '_getDimension',
|
1252
|
+
value: function _getDimension() {
|
1253
|
+
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
1254
|
+
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
1255
|
+
}
|
1256
|
+
}, {
|
1257
|
+
key: '_getParent',
|
1258
|
+
value: function _getParent() {
|
1259
|
+
var _this6 = this;
|
1260
|
+
|
1261
|
+
var parent = $(this._config.parent)[0];
|
1262
|
+
var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
|
1263
|
+
|
1264
|
+
$(parent).find(selector).each(function (i, element) {
|
1265
|
+
_this6._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
1266
|
+
});
|
1267
|
+
|
1268
|
+
return parent;
|
1269
|
+
}
|
1270
|
+
}, {
|
1271
|
+
key: '_addAriaAndCollapsedClass',
|
1272
|
+
value: function _addAriaAndCollapsedClass(element, triggerArray) {
|
1273
|
+
if (element) {
|
1274
|
+
var isOpen = $(element).hasClass(ClassName.IN);
|
1275
|
+
element.setAttribute('aria-expanded', isOpen);
|
1276
|
+
|
1277
|
+
if (triggerArray.length) {
|
1278
|
+
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
// static
|
1284
|
+
|
1285
|
+
}], [{
|
1286
|
+
key: '_getTargetFromElement',
|
1287
|
+
value: function _getTargetFromElement(element) {
|
1288
|
+
var selector = Util.getSelectorFromElement(element);
|
1289
|
+
return selector ? $(selector)[0] : null;
|
1290
|
+
}
|
1291
|
+
}, {
|
1292
|
+
key: '_jQueryInterface',
|
1293
|
+
value: function _jQueryInterface(config) {
|
1294
|
+
return this.each(function () {
|
1295
|
+
var $this = $(this);
|
1296
|
+
var data = $this.data(DATA_KEY);
|
1297
|
+
var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config);
|
1298
|
+
|
1299
|
+
if (!data && _config.toggle && /show|hide/.test(config)) {
|
1300
|
+
_config.toggle = false;
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
if (!data) {
|
1304
|
+
data = new Collapse(this, _config);
|
1305
|
+
$this.data(DATA_KEY, data);
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
if (typeof config === 'string') {
|
1309
|
+
data[config]();
|
1310
|
+
}
|
1311
|
+
});
|
1312
|
+
}
|
1313
|
+
}, {
|
1314
|
+
key: 'VERSION',
|
1315
|
+
get: function get() {
|
1316
|
+
return VERSION;
|
1317
|
+
}
|
1318
|
+
}, {
|
1319
|
+
key: 'Default',
|
1320
|
+
get: function get() {
|
1321
|
+
return Default;
|
1322
|
+
}
|
1323
|
+
}]);
|
1324
|
+
|
1325
|
+
return Collapse;
|
1326
|
+
})();
|
1327
|
+
|
1328
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
1329
|
+
event.preventDefault();
|
1330
|
+
|
1331
|
+
var target = Collapse._getTargetFromElement(this);
|
1332
|
+
var data = $(target).data(DATA_KEY);
|
1333
|
+
var config = data ? 'toggle' : $(this).data();
|
1334
|
+
|
1335
|
+
Collapse._jQueryInterface.call($(target), config);
|
1336
|
+
});
|
1337
|
+
|
1338
|
+
/**
|
1339
|
+
* ------------------------------------------------------------------------
|
1340
|
+
* jQuery
|
1341
|
+
* ------------------------------------------------------------------------
|
1342
|
+
*/
|
1343
|
+
|
1344
|
+
$.fn[NAME] = Collapse._jQueryInterface;
|
1345
|
+
$.fn[NAME].Constructor = Collapse;
|
1346
|
+
$.fn[NAME].noConflict = function () {
|
1347
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
1348
|
+
return Collapse._jQueryInterface;
|
1349
|
+
};
|
1350
|
+
|
1351
|
+
return Collapse;
|
1352
|
+
})(jQuery);
|
1353
|
+
|
1354
|
+
/**
|
1355
|
+
* --------------------------------------------------------------------------
|
1356
|
+
* Bootstrap (v4.0.0): dropdown.js
|
1357
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1358
|
+
* --------------------------------------------------------------------------
|
1359
|
+
*/
|
1360
|
+
|
1361
|
+
var Dropdown = (function ($) {
|
1362
|
+
|
1363
|
+
/**
|
1364
|
+
* ------------------------------------------------------------------------
|
1365
|
+
* Constants
|
1366
|
+
* ------------------------------------------------------------------------
|
1367
|
+
*/
|
1368
|
+
|
1369
|
+
var NAME = 'dropdown';
|
1370
|
+
var VERSION = '4.0.0';
|
1371
|
+
var DATA_KEY = 'bs.dropdown';
|
1372
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
1373
|
+
var DATA_API_KEY = '.data-api';
|
1374
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
1375
|
+
|
1376
|
+
var Event = {
|
1377
|
+
HIDE: 'hide' + EVENT_KEY,
|
1378
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
1379
|
+
SHOW: 'show' + EVENT_KEY,
|
1380
|
+
SHOWN: 'shown' + EVENT_KEY,
|
1381
|
+
CLICK: 'click' + EVENT_KEY,
|
1382
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
1383
|
+
KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
|
1384
|
+
};
|
1385
|
+
|
1386
|
+
var ClassName = {
|
1387
|
+
BACKDROP: 'dropdown-backdrop',
|
1388
|
+
DISABLED: 'disabled',
|
1389
|
+
OPEN: 'open'
|
1390
|
+
};
|
1391
|
+
|
1392
|
+
var Selector = {
|
1393
|
+
BACKDROP: '.dropdown-backdrop',
|
1394
|
+
DATA_TOGGLE: '[data-toggle="dropdown"]',
|
1395
|
+
FORM_CHILD: '.dropdown form',
|
1396
|
+
ROLE_MENU: '[role="menu"]',
|
1397
|
+
ROLE_LISTBOX: '[role="listbox"]',
|
1398
|
+
NAVBAR_NAV: '.navbar-nav',
|
1399
|
+
VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
|
1400
|
+
};
|
1401
|
+
|
1402
|
+
/**
|
1403
|
+
* ------------------------------------------------------------------------
|
1404
|
+
* Class Definition
|
1405
|
+
* ------------------------------------------------------------------------
|
1406
|
+
*/
|
1407
|
+
|
1408
|
+
var Dropdown = (function () {
|
1409
|
+
function Dropdown(element) {
|
1410
|
+
_classCallCheck(this, Dropdown);
|
1411
|
+
|
1412
|
+
this._element = element;
|
1413
|
+
|
1414
|
+
this._addEventListeners();
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
/**
|
1418
|
+
* ------------------------------------------------------------------------
|
1419
|
+
* Data Api implementation
|
1420
|
+
* ------------------------------------------------------------------------
|
1421
|
+
*/
|
1422
|
+
|
1423
|
+
// getters
|
1424
|
+
|
1425
|
+
_createClass(Dropdown, [{
|
1426
|
+
key: 'toggle',
|
1427
|
+
|
1428
|
+
// public
|
1429
|
+
|
1430
|
+
value: function toggle() {
|
1431
|
+
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
1432
|
+
return false;
|
1433
|
+
}
|
1434
|
+
|
1435
|
+
var parent = Dropdown._getParentFromElement(this);
|
1436
|
+
var isActive = $(parent).hasClass(ClassName.OPEN);
|
1437
|
+
|
1438
|
+
Dropdown._clearMenus();
|
1439
|
+
|
1440
|
+
if (isActive) {
|
1441
|
+
return false;
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
|
1445
|
+
|
1446
|
+
// if mobile we use a backdrop because click events don't delegate
|
1447
|
+
var dropdown = document.createElement('div');
|
1448
|
+
dropdown.className = ClassName.BACKDROP;
|
1449
|
+
$(dropdown).insertBefore(this);
|
1450
|
+
$(dropdown).on('click', Dropdown._clearMenus);
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
var relatedTarget = { relatedTarget: this };
|
1454
|
+
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
1455
|
+
|
1456
|
+
$(parent).trigger(showEvent);
|
1457
|
+
|
1458
|
+
if (showEvent.isDefaultPrevented()) {
|
1459
|
+
return false;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
this.focus();
|
1463
|
+
this.setAttribute('aria-expanded', 'true');
|
1464
|
+
|
1465
|
+
$(parent).toggleClass(ClassName.OPEN);
|
1466
|
+
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
|
1467
|
+
|
1468
|
+
return false;
|
1469
|
+
}
|
1470
|
+
}, {
|
1471
|
+
key: 'dispose',
|
1472
|
+
value: function dispose() {
|
1473
|
+
$.removeData(this._element, DATA_KEY);
|
1474
|
+
$(this._element).off(EVENT_KEY);
|
1475
|
+
this._element = null;
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
// private
|
1479
|
+
|
1480
|
+
}, {
|
1481
|
+
key: '_addEventListeners',
|
1482
|
+
value: function _addEventListeners() {
|
1483
|
+
$(this._element).on(Event.CLICK, this.toggle);
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
// static
|
1487
|
+
|
1488
|
+
}], [{
|
1489
|
+
key: '_jQueryInterface',
|
1490
|
+
value: function _jQueryInterface(config) {
|
1491
|
+
return this.each(function () {
|
1492
|
+
var data = $(this).data(DATA_KEY);
|
1493
|
+
|
1494
|
+
if (!data) {
|
1495
|
+
$(this).data(DATA_KEY, data = new Dropdown(this));
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
if (typeof config === 'string') {
|
1499
|
+
data[config].call(this);
|
1500
|
+
}
|
1501
|
+
});
|
1502
|
+
}
|
1503
|
+
}, {
|
1504
|
+
key: '_clearMenus',
|
1505
|
+
value: function _clearMenus(event) {
|
1506
|
+
if (event && event.which === 3) {
|
1507
|
+
return;
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
var backdrop = $(Selector.BACKDROP)[0];
|
1511
|
+
if (backdrop) {
|
1512
|
+
backdrop.parentNode.removeChild(backdrop);
|
1513
|
+
}
|
1514
|
+
|
1515
|
+
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
|
1516
|
+
|
1517
|
+
for (var i = 0; i < toggles.length; i++) {
|
1518
|
+
var _parent = Dropdown._getParentFromElement(toggles[i]);
|
1519
|
+
var relatedTarget = { relatedTarget: toggles[i] };
|
1520
|
+
|
1521
|
+
if (!$(_parent).hasClass(ClassName.OPEN)) {
|
1522
|
+
continue;
|
1523
|
+
}
|
1524
|
+
|
1525
|
+
if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) {
|
1526
|
+
continue;
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
1530
|
+
$(_parent).trigger(hideEvent);
|
1531
|
+
if (hideEvent.isDefaultPrevented()) {
|
1532
|
+
continue;
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
toggles[i].setAttribute('aria-expanded', 'false');
|
1536
|
+
|
1537
|
+
$(_parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
|
1538
|
+
}
|
1539
|
+
}
|
1540
|
+
}, {
|
1541
|
+
key: '_getParentFromElement',
|
1542
|
+
value: function _getParentFromElement(element) {
|
1543
|
+
var parent = undefined;
|
1544
|
+
var selector = Util.getSelectorFromElement(element);
|
1545
|
+
|
1546
|
+
if (selector) {
|
1547
|
+
parent = $(selector)[0];
|
1548
|
+
}
|
1549
|
+
|
1550
|
+
return parent || element.parentNode;
|
1551
|
+
}
|
1552
|
+
}, {
|
1553
|
+
key: '_dataApiKeydownHandler',
|
1554
|
+
value: function _dataApiKeydownHandler(event) {
|
1555
|
+
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
|
1556
|
+
return;
|
1557
|
+
}
|
1558
|
+
|
1559
|
+
event.preventDefault();
|
1560
|
+
event.stopPropagation();
|
1561
|
+
|
1562
|
+
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
1563
|
+
return;
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
var parent = Dropdown._getParentFromElement(this);
|
1567
|
+
var isActive = $(parent).hasClass(ClassName.OPEN);
|
1568
|
+
|
1569
|
+
if (!isActive && event.which !== 27 || isActive && event.which === 27) {
|
1570
|
+
|
1571
|
+
if (event.which === 27) {
|
1572
|
+
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
|
1573
|
+
$(toggle).trigger('focus');
|
1574
|
+
}
|
1575
|
+
|
1576
|
+
$(this).trigger('click');
|
1577
|
+
return;
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
var items = $.makeArray($(Selector.VISIBLE_ITEMS));
|
1581
|
+
|
1582
|
+
items = items.filter(function (item) {
|
1583
|
+
return item.offsetWidth || item.offsetHeight;
|
1584
|
+
});
|
1585
|
+
|
1586
|
+
if (!items.length) {
|
1587
|
+
return;
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
var index = items.indexOf(event.target);
|
1591
|
+
|
1592
|
+
if (event.which === 38 && index > 0) {
|
1593
|
+
// up
|
1594
|
+
index--;
|
1595
|
+
}
|
1596
|
+
|
1597
|
+
if (event.which === 40 && index < items.length - 1) {
|
1598
|
+
// down
|
1599
|
+
index++;
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
if (! ~index) {
|
1603
|
+
index = 0;
|
1604
|
+
}
|
1605
|
+
|
1606
|
+
items[index].focus();
|
1607
|
+
}
|
1608
|
+
}, {
|
1609
|
+
key: 'VERSION',
|
1610
|
+
get: function get() {
|
1611
|
+
return VERSION;
|
1612
|
+
}
|
1613
|
+
}]);
|
1614
|
+
|
1615
|
+
return Dropdown;
|
1616
|
+
})();
|
1617
|
+
|
1618
|
+
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
1619
|
+
e.stopPropagation();
|
1620
|
+
});
|
1621
|
+
|
1622
|
+
/**
|
1623
|
+
* ------------------------------------------------------------------------
|
1624
|
+
* jQuery
|
1625
|
+
* ------------------------------------------------------------------------
|
1626
|
+
*/
|
1627
|
+
|
1628
|
+
$.fn[NAME] = Dropdown._jQueryInterface;
|
1629
|
+
$.fn[NAME].Constructor = Dropdown;
|
1630
|
+
$.fn[NAME].noConflict = function () {
|
1631
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
1632
|
+
return Dropdown._jQueryInterface;
|
1633
|
+
};
|
1634
|
+
|
1635
|
+
return Dropdown;
|
1636
|
+
})(jQuery);
|
1637
|
+
|
1638
|
+
/**
|
1639
|
+
* --------------------------------------------------------------------------
|
1640
|
+
* Bootstrap (v4.0.0): modal.js
|
1641
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1642
|
+
* --------------------------------------------------------------------------
|
1643
|
+
*/
|
1644
|
+
|
1645
|
+
var Modal = (function ($) {
|
1646
|
+
|
1647
|
+
/**
|
1648
|
+
* ------------------------------------------------------------------------
|
1649
|
+
* Constants
|
1650
|
+
* ------------------------------------------------------------------------
|
1651
|
+
*/
|
1652
|
+
|
1653
|
+
var NAME = 'modal';
|
1654
|
+
var VERSION = '4.0.0';
|
1655
|
+
var DATA_KEY = 'bs.modal';
|
1656
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
1657
|
+
var DATA_API_KEY = '.data-api';
|
1658
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
1659
|
+
var TRANSITION_DURATION = 300;
|
1660
|
+
var BACKDROP_TRANSITION_DURATION = 150;
|
1661
|
+
|
1662
|
+
var Default = {
|
1663
|
+
backdrop: true,
|
1664
|
+
keyboard: true,
|
1665
|
+
focus: true,
|
1666
|
+
show: true
|
1667
|
+
};
|
1668
|
+
|
1669
|
+
var DefaultType = {
|
1670
|
+
backdrop: '(boolean|string)',
|
1671
|
+
keyboard: 'boolean',
|
1672
|
+
focus: 'boolean',
|
1673
|
+
show: 'boolean'
|
1674
|
+
};
|
1675
|
+
|
1676
|
+
var Event = {
|
1677
|
+
HIDE: 'hide' + EVENT_KEY,
|
1678
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
1679
|
+
SHOW: 'show' + EVENT_KEY,
|
1680
|
+
SHOWN: 'shown' + EVENT_KEY,
|
1681
|
+
FOCUSIN: 'focusin' + EVENT_KEY,
|
1682
|
+
RESIZE: 'resize' + EVENT_KEY,
|
1683
|
+
CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
|
1684
|
+
KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
|
1685
|
+
MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
|
1686
|
+
MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
|
1687
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
1688
|
+
};
|
1689
|
+
|
1690
|
+
var ClassName = {
|
1691
|
+
SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
|
1692
|
+
BACKDROP: 'modal-backdrop',
|
1693
|
+
OPEN: 'modal-open',
|
1694
|
+
FADE: 'fade',
|
1695
|
+
IN: 'in'
|
1696
|
+
};
|
1697
|
+
|
1698
|
+
var Selector = {
|
1699
|
+
DIALOG: '.modal-dialog',
|
1700
|
+
DATA_TOGGLE: '[data-toggle="modal"]',
|
1701
|
+
DATA_DISMISS: '[data-dismiss="modal"]',
|
1702
|
+
FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'
|
1703
|
+
};
|
1704
|
+
|
1705
|
+
/**
|
1706
|
+
* ------------------------------------------------------------------------
|
1707
|
+
* Class Definition
|
1708
|
+
* ------------------------------------------------------------------------
|
1709
|
+
*/
|
1710
|
+
|
1711
|
+
var Modal = (function () {
|
1712
|
+
function Modal(element, config) {
|
1713
|
+
_classCallCheck(this, Modal);
|
1714
|
+
|
1715
|
+
this._config = this._getConfig(config);
|
1716
|
+
this._element = element;
|
1717
|
+
this._dialog = $(element).find(Selector.DIALOG)[0];
|
1718
|
+
this._backdrop = null;
|
1719
|
+
this._isShown = false;
|
1720
|
+
this._isBodyOverflowing = false;
|
1721
|
+
this._ignoreBackdropClick = false;
|
1722
|
+
this._originalBodyPadding = 0;
|
1723
|
+
this._scrollbarWidth = 0;
|
1724
|
+
}
|
1725
|
+
|
1726
|
+
/**
|
1727
|
+
* ------------------------------------------------------------------------
|
1728
|
+
* Data Api implementation
|
1729
|
+
* ------------------------------------------------------------------------
|
1730
|
+
*/
|
1731
|
+
|
1732
|
+
// getters
|
1733
|
+
|
1734
|
+
_createClass(Modal, [{
|
1735
|
+
key: 'toggle',
|
1736
|
+
|
1737
|
+
// public
|
1738
|
+
|
1739
|
+
value: function toggle(relatedTarget) {
|
1740
|
+
return this._isShown ? this.hide() : this.show(relatedTarget);
|
1741
|
+
}
|
1742
|
+
}, {
|
1743
|
+
key: 'show',
|
1744
|
+
value: function show(relatedTarget) {
|
1745
|
+
var _this7 = this;
|
1746
|
+
|
1747
|
+
var showEvent = $.Event(Event.SHOW, {
|
1748
|
+
relatedTarget: relatedTarget
|
1749
|
+
});
|
1750
|
+
|
1751
|
+
$(this._element).trigger(showEvent);
|
1752
|
+
|
1753
|
+
if (this._isShown || showEvent.isDefaultPrevented()) {
|
1754
|
+
return;
|
1755
|
+
}
|
1756
|
+
|
1757
|
+
this._isShown = true;
|
1758
|
+
|
1759
|
+
this._checkScrollbar();
|
1760
|
+
this._setScrollbar();
|
1761
|
+
|
1762
|
+
$(document.body).addClass(ClassName.OPEN);
|
1763
|
+
|
1764
|
+
this._setEscapeEvent();
|
1765
|
+
this._setResizeEvent();
|
1766
|
+
|
1767
|
+
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
|
1768
|
+
|
1769
|
+
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
1770
|
+
$(_this7._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
1771
|
+
if ($(event.target).is(_this7._element)) {
|
1772
|
+
that._ignoreBackdropClick = true;
|
1773
|
+
}
|
1774
|
+
});
|
1775
|
+
});
|
1776
|
+
|
1777
|
+
this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
|
1778
|
+
}
|
1779
|
+
}, {
|
1780
|
+
key: 'hide',
|
1781
|
+
value: function hide(event) {
|
1782
|
+
if (event) {
|
1783
|
+
event.preventDefault();
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
var hideEvent = $.Event(Event.HIDE);
|
1787
|
+
|
1788
|
+
$(this._element).trigger(hideEvent);
|
1789
|
+
|
1790
|
+
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
1791
|
+
return;
|
1792
|
+
}
|
1793
|
+
|
1794
|
+
this._isShown = false;
|
1795
|
+
|
1796
|
+
this._setEscapeEvent();
|
1797
|
+
this._setResizeEvent();
|
1798
|
+
|
1799
|
+
$(document).off(Event.FOCUSIN);
|
1800
|
+
|
1801
|
+
$(this._element).removeClass(ClassName.IN);
|
1802
|
+
|
1803
|
+
$(this._element).off(Event.CLICK_DISMISS);
|
1804
|
+
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
1805
|
+
|
1806
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
1807
|
+
|
1808
|
+
$(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
|
1809
|
+
} else {
|
1810
|
+
this._hideModal();
|
1811
|
+
}
|
1812
|
+
}
|
1813
|
+
}, {
|
1814
|
+
key: 'dispose',
|
1815
|
+
value: function dispose() {
|
1816
|
+
$.removeData(this._element, DATA_KEY);
|
1817
|
+
|
1818
|
+
$(window).off(EVENT_KEY);
|
1819
|
+
$(document).off(EVENT_KEY);
|
1820
|
+
$(this._element).off(EVENT_KEY);
|
1821
|
+
$(this._backdrop).off(EVENT_KEY);
|
1822
|
+
|
1823
|
+
this._config = null;
|
1824
|
+
this._element = null;
|
1825
|
+
this._dialog = null;
|
1826
|
+
this._backdrop = null;
|
1827
|
+
this._isShown = null;
|
1828
|
+
this._isBodyOverflowing = null;
|
1829
|
+
this._ignoreBackdropClick = null;
|
1830
|
+
this._originalBodyPadding = null;
|
1831
|
+
this._scrollbarWidth = null;
|
1832
|
+
}
|
1833
|
+
|
1834
|
+
// private
|
1835
|
+
|
1836
|
+
}, {
|
1837
|
+
key: '_getConfig',
|
1838
|
+
value: function _getConfig(config) {
|
1839
|
+
config = $.extend({}, Default, config);
|
1840
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
1841
|
+
return config;
|
1842
|
+
}
|
1843
|
+
}, {
|
1844
|
+
key: '_showElement',
|
1845
|
+
value: function _showElement(relatedTarget) {
|
1846
|
+
var _this8 = this;
|
1847
|
+
|
1848
|
+
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
1849
|
+
|
1850
|
+
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
1851
|
+
// don't move modals dom position
|
1852
|
+
document.body.appendChild(this._element);
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
this._element.style.display = 'block';
|
1856
|
+
this._element.scrollTop = 0;
|
1857
|
+
|
1858
|
+
if (transition) {
|
1859
|
+
Util.reflow(this._element);
|
1860
|
+
}
|
1861
|
+
|
1862
|
+
$(this._element).addClass(ClassName.IN);
|
1863
|
+
|
1864
|
+
if (this._config.focus) {
|
1865
|
+
this._enforceFocus();
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
var shownEvent = $.Event(Event.SHOWN, {
|
1869
|
+
relatedTarget: relatedTarget
|
1870
|
+
});
|
1871
|
+
|
1872
|
+
var transitionComplete = function transitionComplete() {
|
1873
|
+
if (_this8._config.focus) {
|
1874
|
+
_this8._element.focus();
|
1875
|
+
}
|
1876
|
+
$(_this8._element).trigger(shownEvent);
|
1877
|
+
};
|
1878
|
+
|
1879
|
+
if (transition) {
|
1880
|
+
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
|
1881
|
+
} else {
|
1882
|
+
transitionComplete();
|
1883
|
+
}
|
1884
|
+
}
|
1885
|
+
}, {
|
1886
|
+
key: '_enforceFocus',
|
1887
|
+
value: function _enforceFocus() {
|
1888
|
+
var _this9 = this;
|
1889
|
+
|
1890
|
+
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
|
1891
|
+
.on(Event.FOCUSIN, function (event) {
|
1892
|
+
if (_this9._element !== event.target && !$(_this9._element).has(event.target).length) {
|
1893
|
+
_this9._element.focus();
|
1894
|
+
}
|
1895
|
+
});
|
1896
|
+
}
|
1897
|
+
}, {
|
1898
|
+
key: '_setEscapeEvent',
|
1899
|
+
value: function _setEscapeEvent() {
|
1900
|
+
var _this10 = this;
|
1901
|
+
|
1902
|
+
if (this._isShown && this._config.keyboard) {
|
1903
|
+
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
1904
|
+
if (event.which === 27) {
|
1905
|
+
_this10.hide();
|
1906
|
+
}
|
1907
|
+
});
|
1908
|
+
} else if (!this._isShown) {
|
1909
|
+
$(this._element).off(Event.KEYDOWN_DISMISS);
|
1910
|
+
}
|
1911
|
+
}
|
1912
|
+
}, {
|
1913
|
+
key: '_setResizeEvent',
|
1914
|
+
value: function _setResizeEvent() {
|
1915
|
+
if (this._isShown) {
|
1916
|
+
$(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
|
1917
|
+
} else {
|
1918
|
+
$(window).off(Event.RESIZE);
|
1919
|
+
}
|
1920
|
+
}
|
1921
|
+
}, {
|
1922
|
+
key: '_hideModal',
|
1923
|
+
value: function _hideModal() {
|
1924
|
+
var _this11 = this;
|
1925
|
+
|
1926
|
+
this._element.style.display = 'none';
|
1927
|
+
this._showBackdrop(function () {
|
1928
|
+
$(document.body).removeClass(ClassName.OPEN);
|
1929
|
+
_this11._resetAdjustments();
|
1930
|
+
_this11._resetScrollbar();
|
1931
|
+
$(_this11._element).trigger(Event.HIDDEN);
|
1932
|
+
});
|
1933
|
+
}
|
1934
|
+
}, {
|
1935
|
+
key: '_removeBackdrop',
|
1936
|
+
value: function _removeBackdrop() {
|
1937
|
+
if (this._backdrop) {
|
1938
|
+
$(this._backdrop).remove();
|
1939
|
+
this._backdrop = null;
|
1940
|
+
}
|
1941
|
+
}
|
1942
|
+
}, {
|
1943
|
+
key: '_showBackdrop',
|
1944
|
+
value: function _showBackdrop(callback) {
|
1945
|
+
var _this12 = this;
|
1946
|
+
|
1947
|
+
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
1948
|
+
|
1949
|
+
if (this._isShown && this._config.backdrop) {
|
1950
|
+
var doAnimate = Util.supportsTransitionEnd() && animate;
|
1951
|
+
|
1952
|
+
this._backdrop = document.createElement('div');
|
1953
|
+
this._backdrop.className = ClassName.BACKDROP;
|
1954
|
+
|
1955
|
+
if (animate) {
|
1956
|
+
$(this._backdrop).addClass(animate);
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
$(this._backdrop).appendTo(document.body);
|
1960
|
+
|
1961
|
+
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
1962
|
+
if (_this12._ignoreBackdropClick) {
|
1963
|
+
_this12._ignoreBackdropClick = false;
|
1964
|
+
return;
|
1965
|
+
}
|
1966
|
+
if (event.target !== event.currentTarget) {
|
1967
|
+
return;
|
1968
|
+
}
|
1969
|
+
if (_this12._config.backdrop === 'static') {
|
1970
|
+
_this12._element.focus();
|
1971
|
+
} else {
|
1972
|
+
_this12.hide();
|
1973
|
+
}
|
1974
|
+
});
|
1975
|
+
|
1976
|
+
if (doAnimate) {
|
1977
|
+
Util.reflow(this._backdrop);
|
1978
|
+
}
|
1979
|
+
|
1980
|
+
$(this._backdrop).addClass(ClassName.IN);
|
1981
|
+
|
1982
|
+
if (!callback) {
|
1983
|
+
return;
|
1984
|
+
}
|
1985
|
+
|
1986
|
+
if (!doAnimate) {
|
1987
|
+
callback();
|
1988
|
+
return;
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
1992
|
+
} else if (!this._isShown && this._backdrop) {
|
1993
|
+
$(this._backdrop).removeClass(ClassName.IN);
|
1994
|
+
|
1995
|
+
var callbackRemove = function callbackRemove() {
|
1996
|
+
_this12._removeBackdrop();
|
1997
|
+
if (callback) {
|
1998
|
+
callback();
|
1999
|
+
}
|
2000
|
+
};
|
2001
|
+
|
2002
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
2003
|
+
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
2004
|
+
} else {
|
2005
|
+
callbackRemove();
|
2006
|
+
}
|
2007
|
+
} else if (callback) {
|
2008
|
+
callback();
|
2009
|
+
}
|
2010
|
+
}
|
2011
|
+
|
2012
|
+
// ----------------------------------------------------------------------
|
2013
|
+
// the following methods are used to handle overflowing modals
|
2014
|
+
// todo (fat): these should probably be refactored out of modal.js
|
2015
|
+
// ----------------------------------------------------------------------
|
2016
|
+
|
2017
|
+
}, {
|
2018
|
+
key: '_handleUpdate',
|
2019
|
+
value: function _handleUpdate() {
|
2020
|
+
this._adjustDialog();
|
2021
|
+
}
|
2022
|
+
}, {
|
2023
|
+
key: '_adjustDialog',
|
2024
|
+
value: function _adjustDialog() {
|
2025
|
+
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
2026
|
+
|
2027
|
+
if (!this._isBodyOverflowing && isModalOverflowing) {
|
2028
|
+
this._element.style.paddingLeft = this._scrollbarWidth + 'px';
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
if (this._isBodyOverflowing && !isModalOverflowing) {
|
2032
|
+
this._element.style.paddingRight = this._scrollbarWidth + 'px~';
|
2033
|
+
}
|
2034
|
+
}
|
2035
|
+
}, {
|
2036
|
+
key: '_resetAdjustments',
|
2037
|
+
value: function _resetAdjustments() {
|
2038
|
+
this._element.style.paddingLeft = '';
|
2039
|
+
this._element.style.paddingRight = '';
|
2040
|
+
}
|
2041
|
+
}, {
|
2042
|
+
key: '_checkScrollbar',
|
2043
|
+
value: function _checkScrollbar() {
|
2044
|
+
var fullWindowWidth = window.innerWidth;
|
2045
|
+
if (!fullWindowWidth) {
|
2046
|
+
// workaround for missing window.innerWidth in IE8
|
2047
|
+
var documentElementRect = document.documentElement.getBoundingClientRect();
|
2048
|
+
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
|
2049
|
+
}
|
2050
|
+
this._isBodyOverflowing = document.body.clientWidth < fullWindowWidth;
|
2051
|
+
this._scrollbarWidth = this._getScrollbarWidth();
|
2052
|
+
}
|
2053
|
+
}, {
|
2054
|
+
key: '_setScrollbar',
|
2055
|
+
value: function _setScrollbar() {
|
2056
|
+
var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
|
2057
|
+
|
2058
|
+
this._originalBodyPadding = document.body.style.paddingRight || '';
|
2059
|
+
|
2060
|
+
if (this._isBodyOverflowing) {
|
2061
|
+
document.body.style.paddingRight = bodyPadding + (this._scrollbarWidth + 'px');
|
2062
|
+
}
|
2063
|
+
}
|
2064
|
+
}, {
|
2065
|
+
key: '_resetScrollbar',
|
2066
|
+
value: function _resetScrollbar() {
|
2067
|
+
document.body.style.paddingRight = this._originalBodyPadding;
|
2068
|
+
}
|
2069
|
+
}, {
|
2070
|
+
key: '_getScrollbarWidth',
|
2071
|
+
value: function _getScrollbarWidth() {
|
2072
|
+
// thx d.walsh
|
2073
|
+
var scrollDiv = document.createElement('div');
|
2074
|
+
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
2075
|
+
document.body.appendChild(scrollDiv);
|
2076
|
+
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
2077
|
+
document.body.removeChild(scrollDiv);
|
2078
|
+
return scrollbarWidth;
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
// static
|
2082
|
+
|
2083
|
+
}], [{
|
2084
|
+
key: '_jQueryInterface',
|
2085
|
+
value: function _jQueryInterface(config, relatedTarget) {
|
2086
|
+
return this.each(function () {
|
2087
|
+
var data = $(this).data(DATA_KEY);
|
2088
|
+
var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
|
2089
|
+
|
2090
|
+
if (!data) {
|
2091
|
+
data = new Modal(this, _config);
|
2092
|
+
$(this).data(DATA_KEY, data);
|
2093
|
+
}
|
2094
|
+
|
2095
|
+
if (typeof config === 'string') {
|
2096
|
+
data[config](relatedTarget);
|
2097
|
+
} else if (_config.show) {
|
2098
|
+
data.show(relatedTarget);
|
2099
|
+
}
|
2100
|
+
});
|
2101
|
+
}
|
2102
|
+
}, {
|
2103
|
+
key: 'VERSION',
|
2104
|
+
get: function get() {
|
2105
|
+
return VERSION;
|
2106
|
+
}
|
2107
|
+
}, {
|
2108
|
+
key: 'Default',
|
2109
|
+
get: function get() {
|
2110
|
+
return Default;
|
2111
|
+
}
|
2112
|
+
}]);
|
2113
|
+
|
2114
|
+
return Modal;
|
2115
|
+
})();
|
2116
|
+
|
2117
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
2118
|
+
var _this13 = this;
|
2119
|
+
|
2120
|
+
var target = undefined;
|
2121
|
+
var selector = Util.getSelectorFromElement(this);
|
2122
|
+
|
2123
|
+
if (selector) {
|
2124
|
+
target = $(selector)[0];
|
2125
|
+
}
|
2126
|
+
|
2127
|
+
var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
|
2128
|
+
|
2129
|
+
if (this.tagName === 'A') {
|
2130
|
+
event.preventDefault();
|
2131
|
+
}
|
2132
|
+
|
2133
|
+
var $target = $(target).one(Event.SHOW, function (showEvent) {
|
2134
|
+
if (showEvent.isDefaultPrevented()) {
|
2135
|
+
// only register focus restorer if modal will actually get shown
|
2136
|
+
return;
|
2137
|
+
}
|
2138
|
+
|
2139
|
+
$target.one(Event.HIDDEN, function () {
|
2140
|
+
if ($(_this13).is(':visible')) {
|
2141
|
+
_this13.focus();
|
2142
|
+
}
|
2143
|
+
});
|
2144
|
+
});
|
2145
|
+
|
2146
|
+
Modal._jQueryInterface.call($(target), config, this);
|
2147
|
+
});
|
2148
|
+
|
2149
|
+
/**
|
2150
|
+
* ------------------------------------------------------------------------
|
2151
|
+
* jQuery
|
2152
|
+
* ------------------------------------------------------------------------
|
2153
|
+
*/
|
2154
|
+
|
2155
|
+
$.fn[NAME] = Modal._jQueryInterface;
|
2156
|
+
$.fn[NAME].Constructor = Modal;
|
2157
|
+
$.fn[NAME].noConflict = function () {
|
2158
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
2159
|
+
return Modal._jQueryInterface;
|
2160
|
+
};
|
2161
|
+
|
2162
|
+
return Modal;
|
2163
|
+
})(jQuery);
|
2164
|
+
|
2165
|
+
/**
|
2166
|
+
* --------------------------------------------------------------------------
|
2167
|
+
* Bootstrap (v4.0.0): scrollspy.js
|
2168
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2169
|
+
* --------------------------------------------------------------------------
|
2170
|
+
*/
|
2171
|
+
|
2172
|
+
var ScrollSpy = (function ($) {
|
2173
|
+
|
2174
|
+
/**
|
2175
|
+
* ------------------------------------------------------------------------
|
2176
|
+
* Constants
|
2177
|
+
* ------------------------------------------------------------------------
|
2178
|
+
*/
|
2179
|
+
|
2180
|
+
var NAME = 'scrollspy';
|
2181
|
+
var VERSION = '4.0.0';
|
2182
|
+
var DATA_KEY = 'bs.scrollspy';
|
2183
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
2184
|
+
var DATA_API_KEY = '.data-api';
|
2185
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
2186
|
+
|
2187
|
+
var Default = {
|
2188
|
+
offset: 10,
|
2189
|
+
method: 'auto',
|
2190
|
+
target: ''
|
2191
|
+
};
|
2192
|
+
|
2193
|
+
var DefaultType = {
|
2194
|
+
offset: 'number',
|
2195
|
+
method: 'string',
|
2196
|
+
target: '(string|element)'
|
2197
|
+
};
|
2198
|
+
|
2199
|
+
var Event = {
|
2200
|
+
ACTIVATE: 'activate' + EVENT_KEY,
|
2201
|
+
SCROLL: 'scroll' + EVENT_KEY,
|
2202
|
+
LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
|
2203
|
+
};
|
2204
|
+
|
2205
|
+
var ClassName = {
|
2206
|
+
DROPDOWN_ITEM: 'dropdown-item',
|
2207
|
+
DROPDOWN_MENU: 'dropdown-menu',
|
2208
|
+
NAV_LINK: 'nav-link',
|
2209
|
+
NAV: 'nav',
|
2210
|
+
ACTIVE: 'active'
|
2211
|
+
};
|
2212
|
+
|
2213
|
+
var Selector = {
|
2214
|
+
DATA_SPY: '[data-spy="scroll"]',
|
2215
|
+
ACTIVE: '.active',
|
2216
|
+
LIST_ITEM: '.list-item',
|
2217
|
+
LI: 'li',
|
2218
|
+
LI_DROPDOWN: 'li.dropdown',
|
2219
|
+
NAV_LINKS: '.nav-link',
|
2220
|
+
DROPDOWN: '.dropdown',
|
2221
|
+
DROPDOWN_ITEMS: '.dropdown-item',
|
2222
|
+
DROPDOWN_TOGGLE: '.dropdown-toggle'
|
2223
|
+
};
|
2224
|
+
|
2225
|
+
var OffsetMethod = {
|
2226
|
+
OFFSET: 'offset',
|
2227
|
+
POSITION: 'position'
|
2228
|
+
};
|
2229
|
+
|
2230
|
+
/**
|
2231
|
+
* ------------------------------------------------------------------------
|
2232
|
+
* Class Definition
|
2233
|
+
* ------------------------------------------------------------------------
|
2234
|
+
*/
|
2235
|
+
|
2236
|
+
var ScrollSpy = (function () {
|
2237
|
+
function ScrollSpy(element, config) {
|
2238
|
+
_classCallCheck(this, ScrollSpy);
|
2239
|
+
|
2240
|
+
this._element = element;
|
2241
|
+
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
2242
|
+
this._config = this._getConfig(config);
|
2243
|
+
this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS);
|
2244
|
+
this._offsets = [];
|
2245
|
+
this._targets = [];
|
2246
|
+
this._activeTarget = null;
|
2247
|
+
this._scrollHeight = 0;
|
2248
|
+
|
2249
|
+
$(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this));
|
2250
|
+
|
2251
|
+
this.refresh();
|
2252
|
+
this._process();
|
2253
|
+
}
|
2254
|
+
|
2255
|
+
/**
|
2256
|
+
* ------------------------------------------------------------------------
|
2257
|
+
* Data Api implementation
|
2258
|
+
* ------------------------------------------------------------------------
|
2259
|
+
*/
|
2260
|
+
|
2261
|
+
// getters
|
2262
|
+
|
2263
|
+
_createClass(ScrollSpy, [{
|
2264
|
+
key: 'refresh',
|
2265
|
+
|
2266
|
+
// public
|
2267
|
+
|
2268
|
+
value: function refresh() {
|
2269
|
+
var _this14 = this;
|
2270
|
+
|
2271
|
+
var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
|
2272
|
+
|
2273
|
+
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
2274
|
+
|
2275
|
+
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
2276
|
+
|
2277
|
+
this._offsets = [];
|
2278
|
+
this._targets = [];
|
2279
|
+
|
2280
|
+
this._scrollHeight = this._getScrollHeight();
|
2281
|
+
|
2282
|
+
var targets = $.makeArray($(this._selector));
|
2283
|
+
|
2284
|
+
targets.map(function (element) {
|
2285
|
+
var target = undefined;
|
2286
|
+
var targetSelector = Util.getSelectorFromElement(element);
|
2287
|
+
|
2288
|
+
if (targetSelector) {
|
2289
|
+
target = $(targetSelector)[0];
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
if (target && (target.offsetWidth || target.offsetHeight)) {
|
2293
|
+
// todo (fat): remove sketch reliance on jQuery position/offset
|
2294
|
+
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
2295
|
+
}
|
2296
|
+
}).filter(function (item) {
|
2297
|
+
return item;
|
2298
|
+
}).sort(function (a, b) {
|
2299
|
+
return a[0] - b[0];
|
2300
|
+
}).forEach(function (item) {
|
2301
|
+
_this14._offsets.push(item[0]);
|
2302
|
+
_this14._targets.push(item[1]);
|
2303
|
+
});
|
2304
|
+
}
|
2305
|
+
}, {
|
2306
|
+
key: 'dispose',
|
2307
|
+
value: function dispose() {
|
2308
|
+
$.removeData(this._element, DATA_KEY);
|
2309
|
+
$(this._scrollElement).off(EVENT_KEY);
|
2310
|
+
|
2311
|
+
this._element = null;
|
2312
|
+
this._scrollElement = null;
|
2313
|
+
this._config = null;
|
2314
|
+
this._selector = null;
|
2315
|
+
this._offsets = null;
|
2316
|
+
this._targets = null;
|
2317
|
+
this._activeTarget = null;
|
2318
|
+
this._scrollHeight = null;
|
2319
|
+
}
|
2320
|
+
|
2321
|
+
// private
|
2322
|
+
|
2323
|
+
}, {
|
2324
|
+
key: '_getConfig',
|
2325
|
+
value: function _getConfig(config) {
|
2326
|
+
config = $.extend({}, Default, config);
|
2327
|
+
|
2328
|
+
if (typeof config.target !== 'string') {
|
2329
|
+
var id = $(config.target).attr('id');
|
2330
|
+
if (!id) {
|
2331
|
+
id = Util.getUID(NAME);
|
2332
|
+
$(config.target).attr('id', id);
|
2333
|
+
}
|
2334
|
+
config.target = '#' + id;
|
2335
|
+
}
|
2336
|
+
|
2337
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
2338
|
+
|
2339
|
+
return config;
|
2340
|
+
}
|
2341
|
+
}, {
|
2342
|
+
key: '_getScrollTop',
|
2343
|
+
value: function _getScrollTop() {
|
2344
|
+
return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
|
2345
|
+
}
|
2346
|
+
}, {
|
2347
|
+
key: '_getScrollHeight',
|
2348
|
+
value: function _getScrollHeight() {
|
2349
|
+
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
2350
|
+
}
|
2351
|
+
}, {
|
2352
|
+
key: '_process',
|
2353
|
+
value: function _process() {
|
2354
|
+
var scrollTop = this._getScrollTop() + this._config.offset;
|
2355
|
+
var scrollHeight = this._getScrollHeight();
|
2356
|
+
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
|
2357
|
+
|
2358
|
+
if (this._scrollHeight !== scrollHeight) {
|
2359
|
+
this.refresh();
|
2360
|
+
}
|
2361
|
+
|
2362
|
+
if (scrollTop >= maxScroll) {
|
2363
|
+
var target = this._targets[this._targets.length - 1];
|
2364
|
+
|
2365
|
+
if (this._activeTarget !== target) {
|
2366
|
+
this._activate(target);
|
2367
|
+
}
|
2368
|
+
}
|
2369
|
+
|
2370
|
+
if (this._activeTarget && scrollTop < this._offsets[0]) {
|
2371
|
+
this._activeTarget = null;
|
2372
|
+
this._clear();
|
2373
|
+
return;
|
2374
|
+
}
|
2375
|
+
|
2376
|
+
for (var i = this._offsets.length; i--;) {
|
2377
|
+
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
|
2378
|
+
|
2379
|
+
if (isActiveTarget) {
|
2380
|
+
this._activate(this._targets[i]);
|
2381
|
+
}
|
2382
|
+
}
|
2383
|
+
}
|
2384
|
+
}, {
|
2385
|
+
key: '_activate',
|
2386
|
+
value: function _activate(target) {
|
2387
|
+
this._activeTarget = target;
|
2388
|
+
|
2389
|
+
this._clear();
|
2390
|
+
|
2391
|
+
var queries = this._selector.split(',');
|
2392
|
+
queries = queries.map(function (selector) {
|
2393
|
+
return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
|
2394
|
+
});
|
2395
|
+
|
2396
|
+
var $link = $(queries.join(','));
|
2397
|
+
|
2398
|
+
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
2399
|
+
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
2400
|
+
$link.addClass(ClassName.ACTIVE);
|
2401
|
+
} else {
|
2402
|
+
// todo (fat) this is kinda sus…
|
2403
|
+
// recursively add actives to tested nav-links
|
2404
|
+
$link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
2405
|
+
}
|
2406
|
+
|
2407
|
+
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
2408
|
+
relatedTarget: target
|
2409
|
+
});
|
2410
|
+
}
|
2411
|
+
}, {
|
2412
|
+
key: '_clear',
|
2413
|
+
value: function _clear() {
|
2414
|
+
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
2415
|
+
}
|
2416
|
+
|
2417
|
+
// static
|
2418
|
+
|
2419
|
+
}], [{
|
2420
|
+
key: '_jQueryInterface',
|
2421
|
+
value: function _jQueryInterface(config) {
|
2422
|
+
return this.each(function () {
|
2423
|
+
var data = $(this).data(DATA_KEY);
|
2424
|
+
var _config = typeof config === 'object' && config || null;
|
2425
|
+
|
2426
|
+
if (!data) {
|
2427
|
+
data = new ScrollSpy(this, _config);
|
2428
|
+
$(this).data(DATA_KEY, data);
|
2429
|
+
}
|
2430
|
+
|
2431
|
+
if (typeof config === 'string') {
|
2432
|
+
data[config]();
|
2433
|
+
}
|
2434
|
+
});
|
2435
|
+
}
|
2436
|
+
}, {
|
2437
|
+
key: 'VERSION',
|
2438
|
+
get: function get() {
|
2439
|
+
return VERSION;
|
2440
|
+
}
|
2441
|
+
}, {
|
2442
|
+
key: 'Default',
|
2443
|
+
get: function get() {
|
2444
|
+
return Default;
|
2445
|
+
}
|
2446
|
+
}]);
|
2447
|
+
|
2448
|
+
return ScrollSpy;
|
2449
|
+
})();
|
2450
|
+
|
2451
|
+
$(window).on(Event.LOAD_DATA_API, function () {
|
2452
|
+
var scrollSpys = $.makeArray($(Selector.DATA_SPY));
|
2453
|
+
|
2454
|
+
for (var i = scrollSpys.length; i--;) {
|
2455
|
+
var $spy = $(scrollSpys[i]);
|
2456
|
+
ScrollSpy._jQueryInterface.call($spy, $spy.data());
|
2457
|
+
}
|
2458
|
+
});
|
2459
|
+
|
2460
|
+
/**
|
2461
|
+
* ------------------------------------------------------------------------
|
2462
|
+
* jQuery
|
2463
|
+
* ------------------------------------------------------------------------
|
2464
|
+
*/
|
2465
|
+
|
2466
|
+
$.fn[NAME] = ScrollSpy._jQueryInterface;
|
2467
|
+
$.fn[NAME].Constructor = ScrollSpy;
|
2468
|
+
$.fn[NAME].noConflict = function () {
|
2469
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
2470
|
+
return ScrollSpy._jQueryInterface;
|
2471
|
+
};
|
2472
|
+
|
2473
|
+
return ScrollSpy;
|
2474
|
+
})(jQuery);
|
2475
|
+
|
2476
|
+
/**
|
2477
|
+
* --------------------------------------------------------------------------
|
2478
|
+
* Bootstrap (v4.0.0): tab.js
|
2479
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2480
|
+
* --------------------------------------------------------------------------
|
2481
|
+
*/
|
2482
|
+
|
2483
|
+
var Tab = (function ($) {
|
2484
|
+
|
2485
|
+
/**
|
2486
|
+
* ------------------------------------------------------------------------
|
2487
|
+
* Constants
|
2488
|
+
* ------------------------------------------------------------------------
|
2489
|
+
*/
|
2490
|
+
|
2491
|
+
var NAME = 'tab';
|
2492
|
+
var VERSION = '4.0.0';
|
2493
|
+
var DATA_KEY = 'bs.tab';
|
2494
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
2495
|
+
var DATA_API_KEY = '.data-api';
|
2496
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
2497
|
+
var TRANSITION_DURATION = 150;
|
2498
|
+
|
2499
|
+
var Event = {
|
2500
|
+
HIDE: 'hide' + EVENT_KEY,
|
2501
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
2502
|
+
SHOW: 'show' + EVENT_KEY,
|
2503
|
+
SHOWN: 'shown' + EVENT_KEY,
|
2504
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
|
2505
|
+
};
|
2506
|
+
|
2507
|
+
var ClassName = {
|
2508
|
+
DROPDOWN_MENU: 'dropdown-menu',
|
2509
|
+
ACTIVE: 'active',
|
2510
|
+
FADE: 'fade',
|
2511
|
+
IN: 'in'
|
2512
|
+
};
|
2513
|
+
|
2514
|
+
var Selector = {
|
2515
|
+
A: 'a',
|
2516
|
+
LI: 'li',
|
2517
|
+
DROPDOWN: '.dropdown',
|
2518
|
+
UL: 'ul:not(.dropdown-menu)',
|
2519
|
+
FADE_CHILD: '> .nav-item .fade, > .fade',
|
2520
|
+
ACTIVE: '.active',
|
2521
|
+
ACTIVE_CHILD: '> .nav-item > .active, > .active',
|
2522
|
+
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
|
2523
|
+
DROPDOWN_TOGGLE: '.dropdown-toggle',
|
2524
|
+
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
|
2525
|
+
};
|
2526
|
+
|
2527
|
+
/**
|
2528
|
+
* ------------------------------------------------------------------------
|
2529
|
+
* Class Definition
|
2530
|
+
* ------------------------------------------------------------------------
|
2531
|
+
*/
|
2532
|
+
|
2533
|
+
var Tab = (function () {
|
2534
|
+
function Tab(element) {
|
2535
|
+
_classCallCheck(this, Tab);
|
2536
|
+
|
2537
|
+
this._element = element;
|
2538
|
+
}
|
2539
|
+
|
2540
|
+
/**
|
2541
|
+
* ------------------------------------------------------------------------
|
2542
|
+
* Data Api implementation
|
2543
|
+
* ------------------------------------------------------------------------
|
2544
|
+
*/
|
2545
|
+
|
2546
|
+
// getters
|
2547
|
+
|
2548
|
+
_createClass(Tab, [{
|
2549
|
+
key: 'show',
|
2550
|
+
|
2551
|
+
// public
|
2552
|
+
|
2553
|
+
value: function show() {
|
2554
|
+
var _this15 = this;
|
2555
|
+
|
2556
|
+
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) {
|
2557
|
+
return;
|
2558
|
+
}
|
2559
|
+
|
2560
|
+
var target = undefined;
|
2561
|
+
var previous = undefined;
|
2562
|
+
var ulElement = $(this._element).closest(Selector.UL)[0];
|
2563
|
+
var selector = Util.getSelectorFromElement(this._element);
|
2564
|
+
|
2565
|
+
if (ulElement) {
|
2566
|
+
previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
|
2567
|
+
previous = previous[previous.length - 1];
|
2568
|
+
}
|
2569
|
+
|
2570
|
+
var hideEvent = $.Event(Event.HIDE, {
|
2571
|
+
relatedTarget: this._element
|
2572
|
+
});
|
2573
|
+
|
2574
|
+
var showEvent = $.Event(Event.SHOW, {
|
2575
|
+
relatedTarget: previous
|
2576
|
+
});
|
2577
|
+
|
2578
|
+
if (previous) {
|
2579
|
+
$(previous).trigger(hideEvent);
|
2580
|
+
}
|
2581
|
+
|
2582
|
+
$(this._element).trigger(showEvent);
|
2583
|
+
|
2584
|
+
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
2585
|
+
return;
|
2586
|
+
}
|
2587
|
+
|
2588
|
+
if (selector) {
|
2589
|
+
target = $(selector)[0];
|
2590
|
+
}
|
2591
|
+
|
2592
|
+
this._activate(this._element, ulElement);
|
2593
|
+
|
2594
|
+
var complete = function complete() {
|
2595
|
+
var hiddenEvent = $.Event(Event.HIDDEN, {
|
2596
|
+
relatedTarget: _this15._element
|
2597
|
+
});
|
2598
|
+
|
2599
|
+
var shownEvent = $.Event(Event.SHOWN, {
|
2600
|
+
relatedTarget: previous
|
2601
|
+
});
|
2602
|
+
|
2603
|
+
$(previous).trigger(hiddenEvent);
|
2604
|
+
$(_this15._element).trigger(shownEvent);
|
2605
|
+
};
|
2606
|
+
|
2607
|
+
if (target) {
|
2608
|
+
this._activate(target, target.parentNode, complete);
|
2609
|
+
} else {
|
2610
|
+
complete();
|
2611
|
+
}
|
2612
|
+
}
|
2613
|
+
}, {
|
2614
|
+
key: 'dispose',
|
2615
|
+
value: function dispose() {
|
2616
|
+
$.removeClass(this._element, DATA_KEY);
|
2617
|
+
this._element = null;
|
2618
|
+
}
|
2619
|
+
|
2620
|
+
// private
|
2621
|
+
|
2622
|
+
}, {
|
2623
|
+
key: '_activate',
|
2624
|
+
value: function _activate(element, container, callback) {
|
2625
|
+
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
2626
|
+
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
2627
|
+
|
2628
|
+
var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
|
2629
|
+
|
2630
|
+
if (active && isTransitioning) {
|
2631
|
+
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
2632
|
+
} else {
|
2633
|
+
complete();
|
2634
|
+
}
|
2635
|
+
|
2636
|
+
if (active) {
|
2637
|
+
$(active).removeClass(ClassName.IN);
|
2638
|
+
}
|
2639
|
+
}
|
2640
|
+
}, {
|
2641
|
+
key: '_transitionComplete',
|
2642
|
+
value: function _transitionComplete(element, active, isTransitioning, callback) {
|
2643
|
+
if (active) {
|
2644
|
+
$(active).removeClass(ClassName.ACTIVE);
|
2645
|
+
|
2646
|
+
var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
2647
|
+
|
2648
|
+
if (dropdownChild) {
|
2649
|
+
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
2650
|
+
}
|
2651
|
+
|
2652
|
+
active.setAttribute('aria-expanded', false);
|
2653
|
+
}
|
2654
|
+
|
2655
|
+
$(element).addClass(ClassName.ACTIVE);
|
2656
|
+
element.setAttribute('aria-expanded', true);
|
2657
|
+
|
2658
|
+
if (isTransitioning) {
|
2659
|
+
Util.reflow(element);
|
2660
|
+
$(element).addClass(ClassName.IN);
|
2661
|
+
} else {
|
2662
|
+
$(element).removeClass(ClassName.FADE);
|
2663
|
+
}
|
2664
|
+
|
2665
|
+
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
2666
|
+
|
2667
|
+
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
2668
|
+
if (dropdownElement) {
|
2669
|
+
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
2670
|
+
}
|
2671
|
+
|
2672
|
+
element.setAttribute('aria-expanded', true);
|
2673
|
+
}
|
2674
|
+
|
2675
|
+
if (callback) {
|
2676
|
+
callback();
|
2677
|
+
}
|
2678
|
+
}
|
2679
|
+
|
2680
|
+
// static
|
2681
|
+
|
2682
|
+
}], [{
|
2683
|
+
key: '_jQueryInterface',
|
2684
|
+
value: function _jQueryInterface(config) {
|
2685
|
+
return this.each(function () {
|
2686
|
+
var $this = $(this);
|
2687
|
+
var data = $this.data(DATA_KEY);
|
2688
|
+
|
2689
|
+
if (!data) {
|
2690
|
+
data = data = new Tab(this);
|
2691
|
+
$this.data(DATA_KEY, data);
|
2692
|
+
}
|
2693
|
+
|
2694
|
+
if (typeof config === 'string') {
|
2695
|
+
data[config]();
|
2696
|
+
}
|
2697
|
+
});
|
2698
|
+
}
|
2699
|
+
}, {
|
2700
|
+
key: 'VERSION',
|
2701
|
+
get: function get() {
|
2702
|
+
return VERSION;
|
2703
|
+
}
|
2704
|
+
}]);
|
2705
|
+
|
2706
|
+
return Tab;
|
2707
|
+
})();
|
2708
|
+
|
2709
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
2710
|
+
event.preventDefault();
|
2711
|
+
Tab._jQueryInterface.call($(this), 'show');
|
2712
|
+
});
|
2713
|
+
|
2714
|
+
/**
|
2715
|
+
* ------------------------------------------------------------------------
|
2716
|
+
* jQuery
|
2717
|
+
* ------------------------------------------------------------------------
|
2718
|
+
*/
|
2719
|
+
|
2720
|
+
$.fn[NAME] = Tab._jQueryInterface;
|
2721
|
+
$.fn[NAME].Constructor = Tab;
|
2722
|
+
$.fn[NAME].noConflict = function () {
|
2723
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
2724
|
+
return Tab._jQueryInterface;
|
2725
|
+
};
|
2726
|
+
|
2727
|
+
return Tab;
|
2728
|
+
})(jQuery);
|
2729
|
+
|
2730
|
+
/**
|
2731
|
+
* --------------------------------------------------------------------------
|
2732
|
+
* Bootstrap (v4.0.0): tooltip.js
|
2733
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2734
|
+
* --------------------------------------------------------------------------
|
2735
|
+
*/
|
2736
|
+
|
2737
|
+
var Tooltip = (function ($) {
|
2738
|
+
|
2739
|
+
/**
|
2740
|
+
* ------------------------------------------------------------------------
|
2741
|
+
* Constants
|
2742
|
+
* ------------------------------------------------------------------------
|
2743
|
+
*/
|
2744
|
+
|
2745
|
+
var NAME = 'tooltip';
|
2746
|
+
var VERSION = '4.0.0';
|
2747
|
+
var DATA_KEY = 'bs.tooltip';
|
2748
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
2749
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
2750
|
+
var TRANSITION_DURATION = 150;
|
2751
|
+
var CLASS_PREFIX = 'bs-tether';
|
2752
|
+
|
2753
|
+
var Default = {
|
2754
|
+
animation: true,
|
2755
|
+
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
2756
|
+
trigger: 'hover focus',
|
2757
|
+
title: '',
|
2758
|
+
delay: 0,
|
2759
|
+
html: false,
|
2760
|
+
selector: false,
|
2761
|
+
placement: 'top',
|
2762
|
+
offset: '0 0',
|
2763
|
+
constraints: []
|
2764
|
+
};
|
2765
|
+
|
2766
|
+
var DefaultType = {
|
2767
|
+
animation: 'boolean',
|
2768
|
+
template: 'string',
|
2769
|
+
title: '(string|function)',
|
2770
|
+
trigger: 'string',
|
2771
|
+
delay: '(number|object)',
|
2772
|
+
html: 'boolean',
|
2773
|
+
selector: '(string|boolean)',
|
2774
|
+
placement: '(string|function)',
|
2775
|
+
offset: 'string',
|
2776
|
+
constraints: 'array'
|
2777
|
+
};
|
2778
|
+
|
2779
|
+
var AttachmentMap = {
|
2780
|
+
TOP: 'bottom center',
|
2781
|
+
RIGHT: 'middle left',
|
2782
|
+
BOTTOM: 'top center',
|
2783
|
+
LEFT: 'middle right'
|
2784
|
+
};
|
2785
|
+
|
2786
|
+
var HoverState = {
|
2787
|
+
IN: 'in',
|
2788
|
+
OUT: 'out'
|
2789
|
+
};
|
2790
|
+
|
2791
|
+
var Event = {
|
2792
|
+
HIDE: 'hide' + EVENT_KEY,
|
2793
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
2794
|
+
SHOW: 'show' + EVENT_KEY,
|
2795
|
+
SHOWN: 'shown' + EVENT_KEY,
|
2796
|
+
INSERTED: 'inserted' + EVENT_KEY,
|
2797
|
+
CLICK: 'click' + EVENT_KEY,
|
2798
|
+
FOCUSIN: 'focusin' + EVENT_KEY,
|
2799
|
+
FOCUSOUT: 'focusout' + EVENT_KEY,
|
2800
|
+
MOUSEENTER: 'mouseenter' + EVENT_KEY,
|
2801
|
+
MOUSELEAVE: 'mouseleave' + EVENT_KEY
|
2802
|
+
};
|
2803
|
+
|
2804
|
+
var ClassName = {
|
2805
|
+
FADE: 'fade',
|
2806
|
+
IN: 'in'
|
2807
|
+
};
|
2808
|
+
|
2809
|
+
var Selector = {
|
2810
|
+
TOOLTIP: '.tooltip',
|
2811
|
+
TOOLTIP_INNER: '.tooltip-inner'
|
2812
|
+
};
|
2813
|
+
|
2814
|
+
var TetherClass = {
|
2815
|
+
element: false,
|
2816
|
+
enabled: false
|
2817
|
+
};
|
2818
|
+
|
2819
|
+
var Trigger = {
|
2820
|
+
HOVER: 'hover',
|
2821
|
+
FOCUS: 'focus',
|
2822
|
+
CLICK: 'click',
|
2823
|
+
MANUAL: 'manual'
|
2824
|
+
};
|
2825
|
+
|
2826
|
+
/**
|
2827
|
+
* ------------------------------------------------------------------------
|
2828
|
+
* Class Definition
|
2829
|
+
* ------------------------------------------------------------------------
|
2830
|
+
*/
|
2831
|
+
|
2832
|
+
var Tooltip = (function () {
|
2833
|
+
function Tooltip(element, config) {
|
2834
|
+
_classCallCheck(this, Tooltip);
|
2835
|
+
|
2836
|
+
// private
|
2837
|
+
this._isEnabled = true;
|
2838
|
+
this._timeout = 0;
|
2839
|
+
this._hoverState = '';
|
2840
|
+
this._activeTrigger = {};
|
2841
|
+
this._tether = null;
|
2842
|
+
|
2843
|
+
// protected
|
2844
|
+
this.element = element;
|
2845
|
+
this.config = this._getConfig(config);
|
2846
|
+
this.tip = null;
|
2847
|
+
|
2848
|
+
this._setListeners();
|
2849
|
+
}
|
2850
|
+
|
2851
|
+
/**
|
2852
|
+
* ------------------------------------------------------------------------
|
2853
|
+
* jQuery
|
2854
|
+
* ------------------------------------------------------------------------
|
2855
|
+
*/
|
2856
|
+
|
2857
|
+
// getters
|
2858
|
+
|
2859
|
+
_createClass(Tooltip, [{
|
2860
|
+
key: 'enable',
|
2861
|
+
|
2862
|
+
// public
|
2863
|
+
|
2864
|
+
value: function enable() {
|
2865
|
+
this._isEnabled = true;
|
2866
|
+
}
|
2867
|
+
}, {
|
2868
|
+
key: 'disable',
|
2869
|
+
value: function disable() {
|
2870
|
+
this._isEnabled = false;
|
2871
|
+
}
|
2872
|
+
}, {
|
2873
|
+
key: 'toggleEnabled',
|
2874
|
+
value: function toggleEnabled() {
|
2875
|
+
this._isEnabled = !this._isEnabled;
|
2876
|
+
}
|
2877
|
+
}, {
|
2878
|
+
key: 'toggle',
|
2879
|
+
value: function toggle(event) {
|
2880
|
+
if (event) {
|
2881
|
+
var dataKey = this.constructor.DATA_KEY;
|
2882
|
+
var context = $(event.currentTarget).data(dataKey);
|
2883
|
+
|
2884
|
+
if (!context) {
|
2885
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
2886
|
+
$(event.currentTarget).data(dataKey, context);
|
2887
|
+
}
|
2888
|
+
|
2889
|
+
context._activeTrigger.click = !context._activeTrigger.click;
|
2890
|
+
|
2891
|
+
if (context._isWithActiveTrigger()) {
|
2892
|
+
context._enter(null, context);
|
2893
|
+
} else {
|
2894
|
+
context._leave(null, context);
|
2895
|
+
}
|
2896
|
+
} else {
|
2897
|
+
|
2898
|
+
if ($(this.getTipElement()).hasClass(ClassName.IN)) {
|
2899
|
+
this._leave(null, this);
|
2900
|
+
return;
|
2901
|
+
}
|
2902
|
+
|
2903
|
+
this._enter(null, this);
|
2904
|
+
}
|
2905
|
+
}
|
2906
|
+
}, {
|
2907
|
+
key: 'dispose',
|
2908
|
+
value: function dispose() {
|
2909
|
+
clearTimeout(this._timeout);
|
2910
|
+
|
2911
|
+
this.cleanupTether();
|
2912
|
+
|
2913
|
+
$.removeData(this.element, this.constructor.DATA_KEY);
|
2914
|
+
|
2915
|
+
$(this.element).off(this.constructor.EVENT_KEY);
|
2916
|
+
|
2917
|
+
if (this.tip) {
|
2918
|
+
$(this.tip).remove();
|
2919
|
+
}
|
2920
|
+
|
2921
|
+
this._isEnabled = null;
|
2922
|
+
this._timeout = null;
|
2923
|
+
this._hoverState = null;
|
2924
|
+
this._activeTrigger = null;
|
2925
|
+
this._tether = null;
|
2926
|
+
|
2927
|
+
this.element = null;
|
2928
|
+
this.config = null;
|
2929
|
+
this.tip = null;
|
2930
|
+
}
|
2931
|
+
}, {
|
2932
|
+
key: 'show',
|
2933
|
+
value: function show() {
|
2934
|
+
var _this16 = this;
|
2935
|
+
|
2936
|
+
var showEvent = $.Event(this.constructor.Event.SHOW);
|
2937
|
+
|
2938
|
+
if (this.isWithContent() && this._isEnabled) {
|
2939
|
+
$(this.element).trigger(showEvent);
|
2940
|
+
|
2941
|
+
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
|
2942
|
+
|
2943
|
+
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
2944
|
+
return;
|
2945
|
+
}
|
2946
|
+
|
2947
|
+
var tip = this.getTipElement();
|
2948
|
+
var tipId = Util.getUID(this.constructor.NAME);
|
2949
|
+
|
2950
|
+
tip.setAttribute('id', tipId);
|
2951
|
+
this.element.setAttribute('aria-describedby', tipId);
|
2952
|
+
|
2953
|
+
this.setContent();
|
2954
|
+
|
2955
|
+
if (this.config.animation) {
|
2956
|
+
$(tip).addClass(ClassName.FADE);
|
2957
|
+
}
|
2958
|
+
|
2959
|
+
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
2960
|
+
|
2961
|
+
var attachment = this._getAttachment(placement);
|
2962
|
+
|
2963
|
+
$(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
|
2964
|
+
|
2965
|
+
$(this.element).trigger(this.constructor.Event.INSERTED);
|
2966
|
+
|
2967
|
+
this._tether = new Tether({
|
2968
|
+
attachment: attachment,
|
2969
|
+
element: tip,
|
2970
|
+
target: this.element,
|
2971
|
+
classes: TetherClass,
|
2972
|
+
classPrefix: CLASS_PREFIX,
|
2973
|
+
offset: this.config.offset,
|
2974
|
+
constraints: this.config.constraints
|
2975
|
+
});
|
2976
|
+
|
2977
|
+
Util.reflow(tip);
|
2978
|
+
this._tether.position();
|
2979
|
+
|
2980
|
+
$(tip).addClass(ClassName.IN);
|
2981
|
+
|
2982
|
+
var complete = function complete() {
|
2983
|
+
var prevHoverState = _this16._hoverState;
|
2984
|
+
_this16._hoverState = null;
|
2985
|
+
|
2986
|
+
$(_this16.element).trigger(_this16.constructor.Event.SHOWN);
|
2987
|
+
|
2988
|
+
if (prevHoverState === HoverState.OUT) {
|
2989
|
+
_this16._leave(null, _this16);
|
2990
|
+
}
|
2991
|
+
};
|
2992
|
+
|
2993
|
+
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
2994
|
+
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
|
2995
|
+
return;
|
2996
|
+
}
|
2997
|
+
|
2998
|
+
complete();
|
2999
|
+
}
|
3000
|
+
}
|
3001
|
+
}, {
|
3002
|
+
key: 'hide',
|
3003
|
+
value: function hide(callback) {
|
3004
|
+
var _this17 = this;
|
3005
|
+
|
3006
|
+
var tip = this.getTipElement();
|
3007
|
+
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
3008
|
+
var complete = function complete() {
|
3009
|
+
if (_this17._hoverState !== HoverState.IN && tip.parentNode) {
|
3010
|
+
tip.parentNode.removeChild(tip);
|
3011
|
+
}
|
3012
|
+
|
3013
|
+
_this17.element.removeAttribute('aria-describedby');
|
3014
|
+
$(_this17.element).trigger(_this17.constructor.Event.HIDDEN);
|
3015
|
+
_this17.cleanupTether();
|
3016
|
+
|
3017
|
+
if (callback) {
|
3018
|
+
callback();
|
3019
|
+
}
|
3020
|
+
};
|
3021
|
+
|
3022
|
+
$(this.element).trigger(hideEvent);
|
3023
|
+
|
3024
|
+
if (hideEvent.isDefaultPrevented()) {
|
3025
|
+
return;
|
3026
|
+
}
|
3027
|
+
|
3028
|
+
$(tip).removeClass(ClassName.IN);
|
3029
|
+
|
3030
|
+
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
3031
|
+
|
3032
|
+
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
3033
|
+
} else {
|
3034
|
+
complete();
|
3035
|
+
}
|
3036
|
+
|
3037
|
+
this._hoverState = '';
|
3038
|
+
}
|
3039
|
+
|
3040
|
+
// protected
|
3041
|
+
|
3042
|
+
}, {
|
3043
|
+
key: 'isWithContent',
|
3044
|
+
value: function isWithContent() {
|
3045
|
+
return Boolean(this.getTitle());
|
3046
|
+
}
|
3047
|
+
}, {
|
3048
|
+
key: 'getTipElement',
|
3049
|
+
value: function getTipElement() {
|
3050
|
+
return this.tip = this.tip || $(this.config.template)[0];
|
3051
|
+
}
|
3052
|
+
}, {
|
3053
|
+
key: 'setContent',
|
3054
|
+
value: function setContent() {
|
3055
|
+
var tip = this.getTipElement();
|
3056
|
+
var title = this.getTitle();
|
3057
|
+
var method = this.config.html ? 'innerHTML' : 'innerText';
|
3058
|
+
|
3059
|
+
$(tip).find(Selector.TOOLTIP_INNER)[0][method] = title;
|
3060
|
+
|
3061
|
+
$(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
3062
|
+
|
3063
|
+
this.cleanupTether();
|
3064
|
+
}
|
3065
|
+
}, {
|
3066
|
+
key: 'getTitle',
|
3067
|
+
value: function getTitle() {
|
3068
|
+
var title = this.element.getAttribute('data-original-title');
|
3069
|
+
|
3070
|
+
if (!title) {
|
3071
|
+
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
3072
|
+
}
|
3073
|
+
|
3074
|
+
return title;
|
3075
|
+
}
|
3076
|
+
}, {
|
3077
|
+
key: 'cleanupTether',
|
3078
|
+
value: function cleanupTether() {
|
3079
|
+
if (this._tether) {
|
3080
|
+
this._tether.destroy();
|
3081
|
+
|
3082
|
+
// clean up after tether's junk classes
|
3083
|
+
// remove after they fix issue
|
3084
|
+
// (https://github.com/HubSpot/tether/issues/36)
|
3085
|
+
$(this.element).removeClass(this._removeTetherClasses);
|
3086
|
+
$(this.tip).removeClass(this._removeTetherClasses);
|
3087
|
+
}
|
3088
|
+
}
|
3089
|
+
|
3090
|
+
// private
|
3091
|
+
|
3092
|
+
}, {
|
3093
|
+
key: '_getAttachment',
|
3094
|
+
value: function _getAttachment(placement) {
|
3095
|
+
return AttachmentMap[placement.toUpperCase()];
|
3096
|
+
}
|
3097
|
+
}, {
|
3098
|
+
key: '_setListeners',
|
3099
|
+
value: function _setListeners() {
|
3100
|
+
var _this18 = this;
|
3101
|
+
|
3102
|
+
var triggers = this.config.trigger.split(' ');
|
3103
|
+
|
3104
|
+
triggers.forEach(function (trigger) {
|
3105
|
+
if (trigger === 'click') {
|
3106
|
+
$(_this18.element).on(_this18.constructor.Event.CLICK, _this18.config.selector, $.proxy(_this18.toggle, _this18));
|
3107
|
+
} else if (trigger !== Trigger.MANUAL) {
|
3108
|
+
var eventIn = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSEENTER : _this18.constructor.Event.FOCUSIN;
|
3109
|
+
var eventOut = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSELEAVE : _this18.constructor.Event.FOCUSOUT;
|
3110
|
+
|
3111
|
+
$(_this18.element).on(eventIn, _this18.config.selector, $.proxy(_this18._enter, _this18)).on(eventOut, _this18.config.selector, $.proxy(_this18._leave, _this18));
|
3112
|
+
}
|
3113
|
+
});
|
3114
|
+
|
3115
|
+
if (this.config.selector) {
|
3116
|
+
this.config = $.extend({}, this.config, {
|
3117
|
+
trigger: 'manual',
|
3118
|
+
selector: ''
|
3119
|
+
});
|
3120
|
+
} else {
|
3121
|
+
this._fixTitle();
|
3122
|
+
}
|
3123
|
+
}
|
3124
|
+
}, {
|
3125
|
+
key: '_removeTetherClasses',
|
3126
|
+
value: function _removeTetherClasses(i, css) {
|
3127
|
+
return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' ');
|
3128
|
+
}
|
3129
|
+
}, {
|
3130
|
+
key: '_fixTitle',
|
3131
|
+
value: function _fixTitle() {
|
3132
|
+
var titleType = typeof this.element.getAttribute('data-original-title');
|
3133
|
+
if (this.element.getAttribute('title') || titleType !== 'string') {
|
3134
|
+
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
|
3135
|
+
this.element.setAttribute('title', '');
|
3136
|
+
}
|
3137
|
+
}
|
3138
|
+
}, {
|
3139
|
+
key: '_enter',
|
3140
|
+
value: function _enter(event, context) {
|
3141
|
+
var dataKey = this.constructor.DATA_KEY;
|
3142
|
+
|
3143
|
+
context = context || $(event.currentTarget).data(dataKey);
|
3144
|
+
|
3145
|
+
if (!context) {
|
3146
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
3147
|
+
$(event.currentTarget).data(dataKey, context);
|
3148
|
+
}
|
3149
|
+
|
3150
|
+
if (event) {
|
3151
|
+
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
3152
|
+
}
|
3153
|
+
|
3154
|
+
if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
|
3155
|
+
context._hoverState = HoverState.IN;
|
3156
|
+
return;
|
3157
|
+
}
|
3158
|
+
|
3159
|
+
clearTimeout(context._timeout);
|
3160
|
+
|
3161
|
+
context._hoverState = HoverState.IN;
|
3162
|
+
|
3163
|
+
if (!context.config.delay || !context.config.delay.show) {
|
3164
|
+
context.show();
|
3165
|
+
return;
|
3166
|
+
}
|
3167
|
+
|
3168
|
+
context._timeout = setTimeout(function () {
|
3169
|
+
if (context._hoverState === HoverState.IN) {
|
3170
|
+
context.show();
|
3171
|
+
}
|
3172
|
+
}, context.config.delay.show);
|
3173
|
+
}
|
3174
|
+
}, {
|
3175
|
+
key: '_leave',
|
3176
|
+
value: function _leave(event, context) {
|
3177
|
+
var dataKey = this.constructor.DATA_KEY;
|
3178
|
+
|
3179
|
+
context = context || $(event.currentTarget).data(dataKey);
|
3180
|
+
|
3181
|
+
if (!context) {
|
3182
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
3183
|
+
$(event.currentTarget).data(dataKey, context);
|
3184
|
+
}
|
3185
|
+
|
3186
|
+
if (event) {
|
3187
|
+
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
3188
|
+
}
|
3189
|
+
|
3190
|
+
if (context._isWithActiveTrigger()) {
|
3191
|
+
return;
|
3192
|
+
}
|
3193
|
+
|
3194
|
+
clearTimeout(context._timeout);
|
3195
|
+
|
3196
|
+
context._hoverState = HoverState.OUT;
|
3197
|
+
|
3198
|
+
if (!context.config.delay || !context.config.delay.hide) {
|
3199
|
+
context.hide();
|
3200
|
+
return;
|
3201
|
+
}
|
3202
|
+
|
3203
|
+
context._timeout = setTimeout(function () {
|
3204
|
+
if (context._hoverState === HoverState.OUT) {
|
3205
|
+
context.hide();
|
3206
|
+
}
|
3207
|
+
}, context.config.delay.hide);
|
3208
|
+
}
|
3209
|
+
}, {
|
3210
|
+
key: '_isWithActiveTrigger',
|
3211
|
+
value: function _isWithActiveTrigger() {
|
3212
|
+
for (var trigger in this._activeTrigger) {
|
3213
|
+
if (this._activeTrigger[trigger]) {
|
3214
|
+
return true;
|
3215
|
+
}
|
3216
|
+
}
|
3217
|
+
|
3218
|
+
return false;
|
3219
|
+
}
|
3220
|
+
}, {
|
3221
|
+
key: '_getConfig',
|
3222
|
+
value: function _getConfig(config) {
|
3223
|
+
config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
|
3224
|
+
|
3225
|
+
if (config.delay && typeof config.delay === 'number') {
|
3226
|
+
config.delay = {
|
3227
|
+
show: config.delay,
|
3228
|
+
hide: config.delay
|
3229
|
+
};
|
3230
|
+
}
|
3231
|
+
|
3232
|
+
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
3233
|
+
|
3234
|
+
return config;
|
3235
|
+
}
|
3236
|
+
}, {
|
3237
|
+
key: '_getDelegateConfig',
|
3238
|
+
value: function _getDelegateConfig() {
|
3239
|
+
var config = {};
|
3240
|
+
|
3241
|
+
if (this.config) {
|
3242
|
+
for (var key in this.config) {
|
3243
|
+
if (this.constructor.Default[key] !== this.config[key]) {
|
3244
|
+
config[key] = this.config[key];
|
3245
|
+
}
|
3246
|
+
}
|
3247
|
+
}
|
3248
|
+
|
3249
|
+
return config;
|
3250
|
+
}
|
3251
|
+
|
3252
|
+
// static
|
3253
|
+
|
3254
|
+
}], [{
|
3255
|
+
key: '_jQueryInterface',
|
3256
|
+
value: function _jQueryInterface(config) {
|
3257
|
+
return this.each(function () {
|
3258
|
+
var data = $(this).data(DATA_KEY);
|
3259
|
+
var _config = typeof config === 'object' ? config : null;
|
3260
|
+
|
3261
|
+
if (!data && /destroy|hide/.test(config)) {
|
3262
|
+
return;
|
3263
|
+
}
|
3264
|
+
|
3265
|
+
if (!data) {
|
3266
|
+
data = new Tooltip(this, _config);
|
3267
|
+
$(this).data(DATA_KEY, data);
|
3268
|
+
}
|
3269
|
+
|
3270
|
+
if (typeof config === 'string') {
|
3271
|
+
data[config]();
|
3272
|
+
}
|
3273
|
+
});
|
3274
|
+
}
|
3275
|
+
}, {
|
3276
|
+
key: 'VERSION',
|
3277
|
+
get: function get() {
|
3278
|
+
return VERSION;
|
3279
|
+
}
|
3280
|
+
}, {
|
3281
|
+
key: 'Default',
|
3282
|
+
get: function get() {
|
3283
|
+
return Default;
|
3284
|
+
}
|
3285
|
+
}, {
|
3286
|
+
key: 'NAME',
|
3287
|
+
get: function get() {
|
3288
|
+
return NAME;
|
3289
|
+
}
|
3290
|
+
}, {
|
3291
|
+
key: 'DATA_KEY',
|
3292
|
+
get: function get() {
|
3293
|
+
return DATA_KEY;
|
3294
|
+
}
|
3295
|
+
}, {
|
3296
|
+
key: 'Event',
|
3297
|
+
get: function get() {
|
3298
|
+
return Event;
|
3299
|
+
}
|
3300
|
+
}, {
|
3301
|
+
key: 'EVENT_KEY',
|
3302
|
+
get: function get() {
|
3303
|
+
return EVENT_KEY;
|
3304
|
+
}
|
3305
|
+
}, {
|
3306
|
+
key: 'DefaultType',
|
3307
|
+
get: function get() {
|
3308
|
+
return DefaultType;
|
3309
|
+
}
|
3310
|
+
}]);
|
3311
|
+
|
3312
|
+
return Tooltip;
|
3313
|
+
})();
|
3314
|
+
|
3315
|
+
$.fn[NAME] = Tooltip._jQueryInterface;
|
3316
|
+
$.fn[NAME].Constructor = Tooltip;
|
3317
|
+
$.fn[NAME].noConflict = function () {
|
3318
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
3319
|
+
return Tooltip._jQueryInterface;
|
3320
|
+
};
|
3321
|
+
|
3322
|
+
return Tooltip;
|
3323
|
+
})(jQuery);
|
3324
|
+
|
3325
|
+
/**
|
3326
|
+
* --------------------------------------------------------------------------
|
3327
|
+
* Bootstrap (v4.0.0): popover.js
|
3328
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
3329
|
+
* --------------------------------------------------------------------------
|
3330
|
+
*/
|
3331
|
+
|
3332
|
+
var Popover = (function ($) {
|
3333
|
+
|
3334
|
+
/**
|
3335
|
+
* ------------------------------------------------------------------------
|
3336
|
+
* Constants
|
3337
|
+
* ------------------------------------------------------------------------
|
3338
|
+
*/
|
3339
|
+
|
3340
|
+
var NAME = 'popover';
|
3341
|
+
var VERSION = '4.0.0';
|
3342
|
+
var DATA_KEY = 'bs.popover';
|
3343
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
3344
|
+
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
3345
|
+
|
3346
|
+
var Default = $.extend({}, Tooltip.Default, {
|
3347
|
+
placement: 'right',
|
3348
|
+
trigger: 'click',
|
3349
|
+
content: '',
|
3350
|
+
template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
|
3351
|
+
});
|
3352
|
+
|
3353
|
+
var DefaultType = $.extend({}, Tooltip.DefaultType, {
|
3354
|
+
content: '(string|function)'
|
3355
|
+
});
|
3356
|
+
|
3357
|
+
var ClassName = {
|
3358
|
+
FADE: 'fade',
|
3359
|
+
IN: 'in'
|
3360
|
+
};
|
3361
|
+
|
3362
|
+
var Selector = {
|
3363
|
+
TITLE: '.popover-title',
|
3364
|
+
CONTENT: '.popover-content',
|
3365
|
+
ARROW: '.popover-arrow'
|
3366
|
+
};
|
3367
|
+
|
3368
|
+
var Event = {
|
3369
|
+
HIDE: 'hide' + EVENT_KEY,
|
3370
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
3371
|
+
SHOW: 'show' + EVENT_KEY,
|
3372
|
+
SHOWN: 'shown' + EVENT_KEY,
|
3373
|
+
INSERTED: 'inserted' + EVENT_KEY,
|
3374
|
+
CLICK: 'click' + EVENT_KEY,
|
3375
|
+
FOCUSIN: 'focusin' + EVENT_KEY,
|
3376
|
+
FOCUSOUT: 'focusout' + EVENT_KEY,
|
3377
|
+
MOUSEENTER: 'mouseenter' + EVENT_KEY,
|
3378
|
+
MOUSELEAVE: 'mouseleave' + EVENT_KEY
|
3379
|
+
};
|
3380
|
+
|
3381
|
+
/**
|
3382
|
+
* ------------------------------------------------------------------------
|
3383
|
+
* Class Definition
|
3384
|
+
* ------------------------------------------------------------------------
|
3385
|
+
*/
|
3386
|
+
|
3387
|
+
var Popover = (function (_Tooltip) {
|
3388
|
+
_inherits(Popover, _Tooltip);
|
3389
|
+
|
3390
|
+
function Popover() {
|
3391
|
+
_classCallCheck(this, Popover);
|
3392
|
+
|
3393
|
+
_get(Object.getPrototypeOf(Popover.prototype), 'constructor', this).apply(this, arguments);
|
3394
|
+
}
|
3395
|
+
|
3396
|
+
/**
|
3397
|
+
* ------------------------------------------------------------------------
|
3398
|
+
* jQuery
|
3399
|
+
* ------------------------------------------------------------------------
|
3400
|
+
*/
|
3401
|
+
|
3402
|
+
_createClass(Popover, [{
|
3403
|
+
key: 'isWithContent',
|
3404
|
+
|
3405
|
+
// overrides
|
3406
|
+
|
3407
|
+
value: function isWithContent() {
|
3408
|
+
return this.getTitle() || this._getContent();
|
3409
|
+
}
|
3410
|
+
}, {
|
3411
|
+
key: 'getTipElement',
|
3412
|
+
value: function getTipElement() {
|
3413
|
+
return this.tip = this.tip || $(this.config.template)[0];
|
3414
|
+
}
|
3415
|
+
}, {
|
3416
|
+
key: 'setContent',
|
3417
|
+
value: function setContent() {
|
3418
|
+
var tip = this.getTipElement();
|
3419
|
+
var title = this.getTitle();
|
3420
|
+
var content = this._getContent();
|
3421
|
+
var titleElement = $(tip).find(Selector.TITLE)[0];
|
3422
|
+
|
3423
|
+
if (titleElement) {
|
3424
|
+
titleElement[this.config.html ? 'innerHTML' : 'innerText'] = title;
|
3425
|
+
}
|
3426
|
+
|
3427
|
+
// we use append for html objects to maintain js events
|
3428
|
+
$(tip).find(Selector.CONTENT).children().detach().end()[this.config.html ? typeof content === 'string' ? 'html' : 'append' : 'text'](content);
|
3429
|
+
|
3430
|
+
$(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
3431
|
+
|
3432
|
+
this.cleanupTether();
|
3433
|
+
}
|
3434
|
+
|
3435
|
+
// private
|
3436
|
+
|
3437
|
+
}, {
|
3438
|
+
key: '_getContent',
|
3439
|
+
value: function _getContent() {
|
3440
|
+
return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
|
3441
|
+
}
|
3442
|
+
|
3443
|
+
// static
|
3444
|
+
|
3445
|
+
}], [{
|
3446
|
+
key: '_jQueryInterface',
|
3447
|
+
value: function _jQueryInterface(config) {
|
3448
|
+
return this.each(function () {
|
3449
|
+
var data = $(this).data(DATA_KEY);
|
3450
|
+
var _config = typeof config === 'object' ? config : null;
|
3451
|
+
|
3452
|
+
if (!data && /destroy|hide/.test(config)) {
|
3453
|
+
return;
|
3454
|
+
}
|
3455
|
+
|
3456
|
+
if (!data) {
|
3457
|
+
data = new Popover(this, _config);
|
3458
|
+
$(this).data(DATA_KEY, data);
|
3459
|
+
}
|
3460
|
+
|
3461
|
+
if (typeof config === 'string') {
|
3462
|
+
data[config]();
|
3463
|
+
}
|
3464
|
+
});
|
3465
|
+
}
|
3466
|
+
}, {
|
3467
|
+
key: 'VERSION',
|
3468
|
+
|
3469
|
+
// getters
|
3470
|
+
|
3471
|
+
get: function get() {
|
3472
|
+
return VERSION;
|
3473
|
+
}
|
3474
|
+
}, {
|
3475
|
+
key: 'Default',
|
3476
|
+
get: function get() {
|
3477
|
+
return Default;
|
3478
|
+
}
|
3479
|
+
}, {
|
3480
|
+
key: 'NAME',
|
3481
|
+
get: function get() {
|
3482
|
+
return NAME;
|
3483
|
+
}
|
3484
|
+
}, {
|
3485
|
+
key: 'DATA_KEY',
|
3486
|
+
get: function get() {
|
3487
|
+
return DATA_KEY;
|
3488
|
+
}
|
3489
|
+
}, {
|
3490
|
+
key: 'Event',
|
3491
|
+
get: function get() {
|
3492
|
+
return Event;
|
3493
|
+
}
|
3494
|
+
}, {
|
3495
|
+
key: 'EVENT_KEY',
|
3496
|
+
get: function get() {
|
3497
|
+
return EVENT_KEY;
|
3498
|
+
}
|
3499
|
+
}, {
|
3500
|
+
key: 'DefaultType',
|
3501
|
+
get: function get() {
|
3502
|
+
return DefaultType;
|
3503
|
+
}
|
3504
|
+
}]);
|
3505
|
+
|
3506
|
+
return Popover;
|
3507
|
+
})(Tooltip);
|
3508
|
+
|
3509
|
+
$.fn[NAME] = Popover._jQueryInterface;
|
3510
|
+
$.fn[NAME].Constructor = Popover;
|
3511
|
+
$.fn[NAME].noConflict = function () {
|
3512
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
3513
|
+
return Popover._jQueryInterface;
|
3514
|
+
};
|
3515
|
+
|
3516
|
+
return Popover;
|
3517
|
+
})(jQuery);
|
3518
|
+
|
3519
|
+
}(jQuery);
|