update bootstrap-3.3.4 and bootbox-4.4.0
This commit is contained in:
133
library/bootstrap/js/bootbox.js
vendored
133
library/bootstrap/js/bootbox.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* bootbox.js [v4.3.0]
|
||||
* bootbox.js [v4.4.0]
|
||||
*
|
||||
* http://bootboxjs.com/license.txt
|
||||
*/
|
||||
@@ -71,8 +71,8 @@
|
||||
var defaults = {
|
||||
// default language
|
||||
locale: "en",
|
||||
// show backdrop or not
|
||||
backdrop: true,
|
||||
// show backdrop or not. Default to static so user has to interact with dialog
|
||||
backdrop: "static",
|
||||
// animate the modal in/out
|
||||
animate: true,
|
||||
// additional class string applied to the top level dialog
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
// so, if the callback can be invoked and it *explicitly returns false*
|
||||
// then we'll set a flag to keep the dialog active...
|
||||
var preserveDialog = $.isFunction(callback) && callback(e) === false;
|
||||
var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false;
|
||||
|
||||
// ... otherwise we'll bin it
|
||||
if (!preserveDialog) {
|
||||
@@ -148,11 +148,6 @@
|
||||
options.buttons = {};
|
||||
}
|
||||
|
||||
// we only support Bootstrap's "static" and false backdrop args
|
||||
// supporting true would mean you could dismiss the dialog without
|
||||
// explicitly interacting with it
|
||||
options.backdrop = options.backdrop ? "static" : false;
|
||||
|
||||
buttons = options.buttons;
|
||||
|
||||
total = getKeyLength(buttons);
|
||||
@@ -312,7 +307,7 @@
|
||||
*/
|
||||
options.buttons.ok.callback = options.onEscape = function() {
|
||||
if ($.isFunction(options.callback)) {
|
||||
return options.callback();
|
||||
return options.callback.call(this);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -329,11 +324,11 @@
|
||||
* overrides; undo anything the user tried to set they shouldn't have
|
||||
*/
|
||||
options.buttons.cancel.callback = options.onEscape = function() {
|
||||
return options.callback(false);
|
||||
return options.callback.call(this, false);
|
||||
};
|
||||
|
||||
options.buttons.confirm.callback = function() {
|
||||
return options.callback(true);
|
||||
return options.callback.call(this, true);
|
||||
};
|
||||
|
||||
// confirm specific validation
|
||||
@@ -387,7 +382,7 @@
|
||||
options.message = form;
|
||||
|
||||
options.buttons.cancel.callback = options.onEscape = function() {
|
||||
return options.callback(null);
|
||||
return options.callback.call(this, null);
|
||||
};
|
||||
|
||||
options.buttons.confirm.callback = function() {
|
||||
@@ -418,7 +413,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
return options.callback(value);
|
||||
return options.callback.call(this, value);
|
||||
};
|
||||
|
||||
options.show = false;
|
||||
@@ -454,6 +449,10 @@
|
||||
var groups = {};
|
||||
inputOptions = options.inputOptions || [];
|
||||
|
||||
if (!$.isArray(inputOptions)) {
|
||||
throw new Error("Please pass an array of input options");
|
||||
}
|
||||
|
||||
if (!inputOptions.length) {
|
||||
throw new Error("prompt with select requires options");
|
||||
}
|
||||
@@ -467,7 +466,6 @@
|
||||
throw new Error("given options in wrong format");
|
||||
}
|
||||
|
||||
|
||||
// ... but override that element if this option sits in a group
|
||||
|
||||
if (option.group) {
|
||||
@@ -525,14 +523,20 @@
|
||||
break;
|
||||
}
|
||||
|
||||
// @TODO provide an attributes option instead
|
||||
// and simply map that as keys: vals
|
||||
if (options.placeholder) {
|
||||
input.attr("placeholder", options.placeholder);
|
||||
}
|
||||
|
||||
if(options.pattern){
|
||||
if (options.pattern) {
|
||||
input.attr("pattern", options.pattern);
|
||||
}
|
||||
|
||||
if (options.maxlength) {
|
||||
input.attr("maxlength", options.maxlength);
|
||||
}
|
||||
|
||||
// now place it in our form
|
||||
form.append(input);
|
||||
|
||||
@@ -552,6 +556,8 @@
|
||||
|
||||
// ...and replace it with one focusing our input, if possible
|
||||
dialog.on("shown.bs.modal", function() {
|
||||
// need the closure here since input isn't
|
||||
// an object otherwise
|
||||
input.focus();
|
||||
});
|
||||
|
||||
@@ -574,6 +580,14 @@
|
||||
onEscape: options.onEscape
|
||||
};
|
||||
|
||||
if ($.fn.modal === undefined) {
|
||||
throw new Error(
|
||||
"$.fn.modal is not defined; please double check you have included " +
|
||||
"the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ " +
|
||||
"for more details."
|
||||
);
|
||||
}
|
||||
|
||||
each(buttons, function(key, button) {
|
||||
|
||||
// @TODO I don't like this string appending to itself; bit dirty. Needs reworking
|
||||
@@ -595,9 +609,7 @@
|
||||
|
||||
if (options.size === "large") {
|
||||
innerDialog.addClass("modal-lg");
|
||||
}
|
||||
|
||||
if (options.size === "small") {
|
||||
} else if (options.size === "small") {
|
||||
innerDialog.addClass("modal-sm");
|
||||
}
|
||||
|
||||
@@ -661,6 +673,30 @@
|
||||
* respective triggers
|
||||
*/
|
||||
|
||||
if (options.backdrop !== "static") {
|
||||
// A boolean true/false according to the Bootstrap docs
|
||||
// should show a dialog the user can dismiss by clicking on
|
||||
// the background.
|
||||
// We always only ever pass static/false to the actual
|
||||
// $.modal function because with `true` we can't trap
|
||||
// this event (the .modal-backdrop swallows it)
|
||||
// However, we still want to sort of respect true
|
||||
// and invoke the escape mechanism instead
|
||||
dialog.on("click.dismiss.bs.modal", function(e) {
|
||||
// @NOTE: the target varies in >= 3.3.x releases since the modal backdrop
|
||||
// moved *inside* the outer dialog rather than *alongside* it
|
||||
if (dialog.children(".modal-backdrop").length) {
|
||||
e.currentTarget = dialog.children(".modal-backdrop").get(0);
|
||||
}
|
||||
|
||||
if (e.target !== e.currentTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
dialog.trigger("escape.close.bb");
|
||||
});
|
||||
}
|
||||
|
||||
dialog.on("escape.close.bb", function(e) {
|
||||
if (callbacks.onEscape) {
|
||||
processCallback(e, dialog, callbacks.onEscape);
|
||||
@@ -676,7 +712,6 @@
|
||||
var callbackKey = $(this).data("bb-handler");
|
||||
|
||||
processCallback(e, dialog, callbacks[callbackKey]);
|
||||
|
||||
});
|
||||
|
||||
dialog.on("click", ".bootbox-close-button", function(e) {
|
||||
@@ -700,7 +735,7 @@
|
||||
$(options.container).append(dialog);
|
||||
|
||||
dialog.modal({
|
||||
backdrop: options.backdrop,
|
||||
backdrop: options.backdrop ? "static": false,
|
||||
keyboard: false,
|
||||
show: false
|
||||
});
|
||||
@@ -759,6 +794,11 @@
|
||||
* unlikely to be required. If this gets too large it can be split out into separate JS files.
|
||||
*/
|
||||
var locales = {
|
||||
bg_BG : {
|
||||
OK : "Ок",
|
||||
CANCEL : "Отказ",
|
||||
CONFIRM : "Потвърждавам"
|
||||
},
|
||||
br : {
|
||||
OK : "OK",
|
||||
CANCEL : "Cancelar",
|
||||
@@ -799,6 +839,11 @@
|
||||
CANCEL : "Katkesta",
|
||||
CONFIRM : "OK"
|
||||
},
|
||||
fa : {
|
||||
OK : "قبول",
|
||||
CANCEL : "لغو",
|
||||
CONFIRM : "تایید"
|
||||
},
|
||||
fi : {
|
||||
OK : "OK",
|
||||
CANCEL : "Peruuta",
|
||||
@@ -814,6 +859,16 @@
|
||||
CANCEL : "ביטול",
|
||||
CONFIRM : "אישור"
|
||||
},
|
||||
hu : {
|
||||
OK : "OK",
|
||||
CANCEL : "Mégsem",
|
||||
CONFIRM : "Megerősít"
|
||||
},
|
||||
hr : {
|
||||
OK : "OK",
|
||||
CANCEL : "Odustani",
|
||||
CONFIRM : "Potvrdi"
|
||||
},
|
||||
id : {
|
||||
OK : "OK",
|
||||
CANCEL : "Batal",
|
||||
@@ -864,11 +919,21 @@
|
||||
CANCEL : "Отмена",
|
||||
CONFIRM : "Применить"
|
||||
},
|
||||
sq : {
|
||||
OK : "OK",
|
||||
CANCEL : "Anulo",
|
||||
CONFIRM : "Prano"
|
||||
},
|
||||
sv : {
|
||||
OK : "OK",
|
||||
CANCEL : "Avbryt",
|
||||
CONFIRM : "OK"
|
||||
},
|
||||
th : {
|
||||
OK : "ตกลง",
|
||||
CANCEL : "ยกเลิก",
|
||||
CONFIRM : "ยืนยัน"
|
||||
},
|
||||
tr : {
|
||||
OK : "Tamam",
|
||||
CANCEL : "İptal",
|
||||
@@ -886,6 +951,32 @@
|
||||
}
|
||||
};
|
||||
|
||||
exports.addLocale = function(name, values) {
|
||||
$.each(["OK", "CANCEL", "CONFIRM"], function(_, v) {
|
||||
if (!values[v]) {
|
||||
throw new Error("Please supply a translation for '" + v + "'");
|
||||
}
|
||||
});
|
||||
|
||||
locales[name] = {
|
||||
OK: values.OK,
|
||||
CANCEL: values.CANCEL,
|
||||
CONFIRM: values.CONFIRM
|
||||
};
|
||||
|
||||
return exports;
|
||||
};
|
||||
|
||||
exports.removeLocale = function(name) {
|
||||
delete locales[name];
|
||||
|
||||
return exports;
|
||||
};
|
||||
|
||||
exports.setLocale = function(name) {
|
||||
return exports.setDefaults("locale", name);
|
||||
};
|
||||
|
||||
exports.init = function(_$) {
|
||||
return init(_$ || $);
|
||||
};
|
||||
|
4
library/bootstrap/js/bootbox.min.js
vendored
4
library/bootstrap/js/bootbox.min.js
vendored
File diff suppressed because one or more lines are too long
281
library/bootstrap/js/bootstrap.js
vendored
281
library/bootstrap/js/bootstrap.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Bootstrap v3.3.1 (http://getbootstrap.com)
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Bootstrap v3.3.4 (http://getbootstrap.com)
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
+function ($) {
|
||||
'use strict';
|
||||
var version = $.fn.jquery.split(' ')[0].split('.')
|
||||
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
|
||||
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
|
||||
@@ -16,10 +17,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: transition.js v3.3.1
|
||||
* Bootstrap: transition.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#transitions
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -76,10 +77,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: alert.js v3.3.1
|
||||
* Bootstrap: alert.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#alerts
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -95,7 +96,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.VERSION = '3.3.1'
|
||||
Alert.VERSION = '3.3.4'
|
||||
|
||||
Alert.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -171,10 +172,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: button.js v3.3.1
|
||||
* Bootstrap: button.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#buttons
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -191,7 +192,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
Button.VERSION = '3.3.1'
|
||||
Button.VERSION = '3.3.4'
|
||||
|
||||
Button.DEFAULTS = {
|
||||
loadingText: 'loading...'
|
||||
@@ -288,10 +289,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: carousel.js v3.3.1
|
||||
* Bootstrap: carousel.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#carousel
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -306,10 +307,10 @@ if (typeof jQuery === 'undefined') {
|
||||
this.$element = $(element)
|
||||
this.$indicators = this.$element.find('.carousel-indicators')
|
||||
this.options = options
|
||||
this.paused =
|
||||
this.sliding =
|
||||
this.interval =
|
||||
this.$active =
|
||||
this.paused = null
|
||||
this.sliding = null
|
||||
this.interval = null
|
||||
this.$active = null
|
||||
this.$items = null
|
||||
|
||||
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
||||
@@ -319,7 +320,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.VERSION = '3.3.1'
|
||||
Carousel.VERSION = '3.3.4'
|
||||
|
||||
Carousel.TRANSITION_DURATION = 600
|
||||
|
||||
@@ -359,8 +360,11 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Carousel.prototype.getItemForDirection = function (direction, active) {
|
||||
var delta = direction == 'prev' ? -1 : 1
|
||||
var activeIndex = this.getItemIndex(active)
|
||||
var willWrap = (direction == 'prev' && activeIndex === 0)
|
||||
|| (direction == 'next' && activeIndex == (this.$items.length - 1))
|
||||
if (willWrap && !this.options.wrap) return active
|
||||
var delta = direction == 'prev' ? -1 : 1
|
||||
var itemIndex = (activeIndex + delta) % this.$items.length
|
||||
return this.$items.eq(itemIndex)
|
||||
}
|
||||
@@ -405,14 +409,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var $next = next || this.getItemForDirection(type, $active)
|
||||
var isCycling = this.interval
|
||||
var direction = type == 'next' ? 'left' : 'right'
|
||||
var fallback = type == 'next' ? 'first' : 'last'
|
||||
var that = this
|
||||
|
||||
if (!$next.length) {
|
||||
if (!this.options.wrap) return
|
||||
$next = this.$element.find('.item')[fallback]()
|
||||
}
|
||||
|
||||
if ($next.hasClass('active')) return (this.sliding = false)
|
||||
|
||||
var relatedTarget = $next[0]
|
||||
@@ -529,10 +527,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: collapse.js v3.3.1
|
||||
* Bootstrap: collapse.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#collapse
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -546,7 +544,8 @@ if (typeof jQuery === 'undefined') {
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
|
||||
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
|
||||
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
|
||||
this.transitioning = null
|
||||
|
||||
if (this.options.parent) {
|
||||
@@ -558,13 +557,12 @@ if (typeof jQuery === 'undefined') {
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.VERSION = '3.3.1'
|
||||
Collapse.VERSION = '3.3.4'
|
||||
|
||||
Collapse.TRANSITION_DURATION = 350
|
||||
|
||||
Collapse.DEFAULTS = {
|
||||
toggle: true,
|
||||
trigger: '[data-toggle="collapse"]'
|
||||
toggle: true
|
||||
}
|
||||
|
||||
Collapse.prototype.dimension = function () {
|
||||
@@ -576,7 +574,7 @@ if (typeof jQuery === 'undefined') {
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
var activesData
|
||||
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
|
||||
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
|
||||
|
||||
if (actives && actives.length) {
|
||||
activesData = actives.data('bs.collapse')
|
||||
@@ -702,7 +700,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var data = $this.data('bs.collapse')
|
||||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data && options.toggle && option == 'show') options.toggle = false
|
||||
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
|
||||
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
@@ -733,7 +731,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
var $target = getTargetFromTrigger($this)
|
||||
var data = $target.data('bs.collapse')
|
||||
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this })
|
||||
var option = data ? 'toggle' : $this.data()
|
||||
|
||||
Plugin.call($target, option)
|
||||
})
|
||||
@@ -741,10 +739,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.3.1
|
||||
* Bootstrap: dropdown.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -761,7 +759,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
Dropdown.VERSION = '3.3.1'
|
||||
Dropdown.VERSION = '3.3.4'
|
||||
|
||||
Dropdown.prototype.toggle = function (e) {
|
||||
var $this = $(this)
|
||||
@@ -814,7 +812,7 @@ if (typeof jQuery === 'undefined') {
|
||||
return $this.trigger('click')
|
||||
}
|
||||
|
||||
var desc = ' li:not(.divider):visible a'
|
||||
var desc = ' li:not(.disabled):visible a'
|
||||
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
|
||||
|
||||
if (!$items.length) return
|
||||
@@ -903,10 +901,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.3.1
|
||||
* Bootstrap: modal.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#modals
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -918,12 +916,15 @@ if (typeof jQuery === 'undefined') {
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$backdrop =
|
||||
this.isShown = null
|
||||
this.scrollbarWidth = 0
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$dialog = this.$element.find('.modal-dialog')
|
||||
this.$backdrop = null
|
||||
this.isShown = null
|
||||
this.originalBodyPad = null
|
||||
this.scrollbarWidth = 0
|
||||
this.ignoreBackdropClick = false
|
||||
|
||||
if (this.options.remote) {
|
||||
this.$element
|
||||
@@ -934,7 +935,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
Modal.VERSION = '3.3.1'
|
||||
Modal.VERSION = '3.3.4'
|
||||
|
||||
Modal.TRANSITION_DURATION = 300
|
||||
Modal.BACKDROP_TRANSITION_DURATION = 150
|
||||
@@ -968,6 +969,12 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||
|
||||
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
|
||||
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
|
||||
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
|
||||
})
|
||||
})
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
@@ -979,7 +986,6 @@ if (typeof jQuery === 'undefined') {
|
||||
.show()
|
||||
.scrollTop(0)
|
||||
|
||||
if (that.options.backdrop) that.adjustBackdrop()
|
||||
that.adjustDialog()
|
||||
|
||||
if (transition) {
|
||||
@@ -995,7 +1001,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
transition ?
|
||||
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||
that.$dialog // wait for modal to slide in
|
||||
.one('bsTransitionEnd', function () {
|
||||
that.$element.trigger('focus').trigger(e)
|
||||
})
|
||||
@@ -1024,6 +1030,9 @@ if (typeof jQuery === 'undefined') {
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
.off('click.dismiss.bs.modal')
|
||||
.off('mouseup.dismiss.bs.modal')
|
||||
|
||||
this.$dialog.off('mousedown.dismiss.bs.modal')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.$element
|
||||
@@ -1084,13 +1093,18 @@ if (typeof jQuery === 'undefined') {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.prependTo(this.$element)
|
||||
.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||
if (e.target !== e.currentTarget) return
|
||||
this.options.backdrop == 'static'
|
||||
? this.$element[0].focus.call(this.$element[0])
|
||||
: this.hide.call(this)
|
||||
}, this))
|
||||
.appendTo(this.$body)
|
||||
|
||||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||
if (this.ignoreBackdropClick) {
|
||||
this.ignoreBackdropClick = false
|
||||
return
|
||||
}
|
||||
if (e.target !== e.currentTarget) return
|
||||
this.options.backdrop == 'static'
|
||||
? this.$element[0].focus()
|
||||
: this.hide()
|
||||
}, this))
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
@@ -1125,16 +1139,9 @@ if (typeof jQuery === 'undefined') {
|
||||
// these following methods are used to handle overflowing modals
|
||||
|
||||
Modal.prototype.handleUpdate = function () {
|
||||
if (this.options.backdrop) this.adjustBackdrop()
|
||||
this.adjustDialog()
|
||||
}
|
||||
|
||||
Modal.prototype.adjustBackdrop = function () {
|
||||
this.$backdrop
|
||||
.css('height', 0)
|
||||
.css('height', this.$element[0].scrollHeight)
|
||||
}
|
||||
|
||||
Modal.prototype.adjustDialog = function () {
|
||||
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
@@ -1152,17 +1159,23 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Modal.prototype.checkScrollbar = function () {
|
||||
this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
|
||||
var fullWindowWidth = window.innerWidth
|
||||
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
|
||||
var documentElementRect = document.documentElement.getBoundingClientRect()
|
||||
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
|
||||
}
|
||||
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
||||
this.scrollbarWidth = this.measureScrollbar()
|
||||
}
|
||||
|
||||
Modal.prototype.setScrollbar = function () {
|
||||
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
||||
this.originalBodyPad = document.body.style.paddingRight || ''
|
||||
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
||||
}
|
||||
|
||||
Modal.prototype.resetScrollbar = function () {
|
||||
this.$body.css('padding-right', '')
|
||||
this.$body.css('padding-right', this.originalBodyPad)
|
||||
}
|
||||
|
||||
Modal.prototype.measureScrollbar = function () { // thx walsh
|
||||
@@ -1228,11 +1241,11 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tooltip.js v3.3.1
|
||||
* Bootstrap: tooltip.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#tooltip
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1244,17 +1257,17 @@ if (typeof jQuery === 'undefined') {
|
||||
// ===============================
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.type =
|
||||
this.options =
|
||||
this.enabled =
|
||||
this.timeout =
|
||||
this.hoverState =
|
||||
this.type = null
|
||||
this.options = null
|
||||
this.enabled = null
|
||||
this.timeout = null
|
||||
this.hoverState = null
|
||||
this.$element = null
|
||||
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.VERSION = '3.3.1'
|
||||
Tooltip.VERSION = '3.3.4'
|
||||
|
||||
Tooltip.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -1281,6 +1294,10 @@ if (typeof jQuery === 'undefined') {
|
||||
this.options = this.getOptions(options)
|
||||
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
||||
|
||||
if (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!')
|
||||
}
|
||||
|
||||
var triggers = this.options.trigger.split(' ')
|
||||
|
||||
for (var i = triggers.length; i--;) {
|
||||
@@ -1501,10 +1518,10 @@ if (typeof jQuery === 'undefined') {
|
||||
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
||||
}
|
||||
|
||||
Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) {
|
||||
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
||||
this.arrow()
|
||||
.css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
||||
.css(isHorizontal ? 'top' : 'left', '')
|
||||
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
||||
.css(isVertical ? 'top' : 'left', '')
|
||||
}
|
||||
|
||||
Tooltip.prototype.setContent = function () {
|
||||
@@ -1517,7 +1534,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
Tooltip.prototype.hide = function (callback) {
|
||||
var that = this
|
||||
var $tip = this.tip()
|
||||
var $tip = $(this.$tip)
|
||||
var e = $.Event('hide.bs.' + this.type)
|
||||
|
||||
function complete() {
|
||||
@@ -1534,7 +1551,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
$.support.transition && $tip.hasClass('fade') ?
|
||||
$tip
|
||||
.one('bsTransitionEnd', complete)
|
||||
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
||||
@@ -1575,10 +1592,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||
|
||||
}
|
||||
|
||||
@@ -1674,18 +1691,12 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
function Plugin(option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
var selector = options && options.selector
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy') return
|
||||
if (selector) {
|
||||
if (!data) $this.data('bs.tooltip', (data = {}))
|
||||
if (!data[selector]) data[selector] = new Tooltip(this, options)
|
||||
} else {
|
||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
}
|
||||
if (!data && /destroy|hide/.test(option)) return
|
||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
@@ -1707,10 +1718,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: popover.js v3.3.1
|
||||
* Bootstrap: popover.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#popovers
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1727,7 +1738,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||
|
||||
Popover.VERSION = '3.3.1'
|
||||
Popover.VERSION = '3.3.4'
|
||||
|
||||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||
placement: 'right',
|
||||
@@ -1783,29 +1794,18 @@ if (typeof jQuery === 'undefined') {
|
||||
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
||||
}
|
||||
|
||||
Popover.prototype.tip = function () {
|
||||
if (!this.$tip) this.$tip = $(this.options.template)
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
|
||||
// POPOVER PLUGIN DEFINITION
|
||||
// =========================
|
||||
|
||||
function Plugin(option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.popover')
|
||||
var options = typeof option == 'object' && option
|
||||
var selector = options && options.selector
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.popover')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy') return
|
||||
if (selector) {
|
||||
if (!data) $this.data('bs.popover', (data = {}))
|
||||
if (!data[selector]) data[selector] = new Popover(this, options)
|
||||
} else {
|
||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||
}
|
||||
if (!data && /destroy|hide/.test(option)) return
|
||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
@@ -1827,10 +1827,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: scrollspy.js v3.3.1
|
||||
* Bootstrap: scrollspy.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#scrollspy
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1842,10 +1842,8 @@ if (typeof jQuery === 'undefined') {
|
||||
// ==========================
|
||||
|
||||
function ScrollSpy(element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
|
||||
this.$body = $('body')
|
||||
this.$scrollElement = $(element).is('body') ? $(window) : $(element)
|
||||
this.$body = $(document.body)
|
||||
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
|
||||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||
this.selector = (this.options.target || '') + ' .nav li > a'
|
||||
this.offsets = []
|
||||
@@ -1853,12 +1851,12 @@ if (typeof jQuery === 'undefined') {
|
||||
this.activeTarget = null
|
||||
this.scrollHeight = 0
|
||||
|
||||
this.$scrollElement.on('scroll.bs.scrollspy', process)
|
||||
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
|
||||
this.refresh()
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.VERSION = '3.3.1'
|
||||
ScrollSpy.VERSION = '3.3.4'
|
||||
|
||||
ScrollSpy.DEFAULTS = {
|
||||
offset: 10
|
||||
@@ -1869,20 +1867,19 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
ScrollSpy.prototype.refresh = function () {
|
||||
var offsetMethod = 'offset'
|
||||
var offsetBase = 0
|
||||
var that = this
|
||||
var offsetMethod = 'offset'
|
||||
var offsetBase = 0
|
||||
|
||||
this.offsets = []
|
||||
this.targets = []
|
||||
this.scrollHeight = this.getScrollHeight()
|
||||
|
||||
if (!$.isWindow(this.$scrollElement[0])) {
|
||||
offsetMethod = 'position'
|
||||
offsetBase = this.$scrollElement.scrollTop()
|
||||
}
|
||||
|
||||
this.offsets = []
|
||||
this.targets = []
|
||||
this.scrollHeight = this.getScrollHeight()
|
||||
|
||||
var self = this
|
||||
|
||||
this.$body
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
@@ -1897,8 +1894,8 @@ if (typeof jQuery === 'undefined') {
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
self.offsets.push(this[0])
|
||||
self.targets.push(this[1])
|
||||
that.offsets.push(this[0])
|
||||
that.targets.push(this[1])
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1927,7 +1924,7 @@ if (typeof jQuery === 'undefined') {
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||
&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
|
||||
&& this.activate(targets[i])
|
||||
}
|
||||
}
|
||||
@@ -1938,8 +1935,8 @@ if (typeof jQuery === 'undefined') {
|
||||
this.clear()
|
||||
|
||||
var selector = this.selector +
|
||||
'[data-target="' + target + '"],' +
|
||||
this.selector + '[href="' + target + '"]'
|
||||
'[data-target="' + target + '"],' +
|
||||
this.selector + '[href="' + target + '"]'
|
||||
|
||||
var active = $(selector)
|
||||
.parents('li')
|
||||
@@ -2003,10 +2000,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tab.js v3.3.1
|
||||
* Bootstrap: tab.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#tabs
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2021,7 +2018,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.VERSION = '3.3.1'
|
||||
Tab.VERSION = '3.3.4'
|
||||
|
||||
Tab.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -2092,7 +2089,7 @@ if (typeof jQuery === 'undefined') {
|
||||
element.removeClass('fade')
|
||||
}
|
||||
|
||||
if (element.parent('.dropdown-menu')) {
|
||||
if (element.parent('.dropdown-menu').length) {
|
||||
element
|
||||
.closest('li.dropdown')
|
||||
.addClass('active')
|
||||
@@ -2157,10 +2154,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: affix.js v3.3.1
|
||||
* Bootstrap: affix.js v3.3.4
|
||||
* http://getbootstrap.com/javascript/#affix
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2179,14 +2176,14 @@ if (typeof jQuery === 'undefined') {
|
||||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||
|
||||
this.$element = $(element)
|
||||
this.affixed =
|
||||
this.unpin =
|
||||
this.affixed = null
|
||||
this.unpin = null
|
||||
this.pinnedOffset = null
|
||||
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.VERSION = '3.3.1'
|
||||
Affix.VERSION = '3.3.4'
|
||||
|
||||
Affix.RESET = 'affix affix-top affix-bottom'
|
||||
|
||||
@@ -2211,7 +2208,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var colliderTop = initializing ? scrollTop : position.top
|
||||
var colliderHeight = initializing ? targetHeight : height
|
||||
|
||||
if (offsetTop != null && colliderTop <= offsetTop) return 'top'
|
||||
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
|
||||
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
|
||||
|
||||
return false
|
||||
@@ -2236,7 +2233,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var offset = this.options.offset
|
||||
var offsetTop = offset.top
|
||||
var offsetBottom = offset.bottom
|
||||
var scrollHeight = $('body').height()
|
||||
var scrollHeight = $(document.body).height()
|
||||
|
||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
||||
|
8
library/bootstrap/js/bootstrap.min.js
vendored
8
library/bootstrap/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user