"];
-
- if (options['header']) {
- var closeButton = '';
- if (typeof options['headerCloseButton'] == 'undefined' || options['headerCloseButton']) {
- closeButton = "×";
- }
-
- parts.push("
"+closeButton+"
"+options['header']+"
");
- }
-
- // push an empty body into which we'll inject the proper content later
- parts.push("");
-
- if (buttons) {
- parts.push("")
- }
-
- parts.push("
");
-
- var div = $(parts.join("\n"));
-
- // check whether we should fade in/out
- var shouldFade = (typeof options.animate === 'undefined') ? _animate : options.animate;
-
- if (shouldFade) {
- div.addClass("fade");
- }
-
- // now we've built up the div properly we can inject the content whether it was a string or a jQuery object
- $(".modal-body", div).html(str);
-
- div.bind('hidden', function() {
- div.remove();
- });
-
- div.bind('hide', function() {
- if (hideSource == 'escape' &&
- typeof options.onEscape == 'function') {
- options.onEscape();
- }
- });
-
- // hook into the modal's keyup trigger to check for the escape key
- $(document).bind('keyup.modal', function ( e ) {
- if (e.which == 27) {
- hideSource = 'escape';
- }
- });
-
- // well, *if* we have a primary - give the last dom element (first displayed) focus
- div.bind('shown', function() {
- $("a.btn-primary:last", div).focus();
- });
-
- // wire up button handlers
- div.on('click', '.modal-footer a, a.close', function(e) {
- var handler = $(this).data("handler"),
- cb = callbacks[handler],
- hideModal = null;
-
- if (typeof cb == 'function') {
- hideModal = cb();
- }
- if (hideModal !== false){
- e.preventDefault();
- hideSource = 'button';
- div.modal("hide");
- }
- });
-
- if (options.keyboard == null) {
- options.keyboard = (typeof options.onEscape == 'function');
- }
-
- $("body").append(div);
-
- div.modal({
- "backdrop" : options.backdrop || true,
- "keyboard" : options.keyboard
- });
-
- return div;
- }
-
- that.hideAll = function() {
- $(".bootbox").modal("hide");
- }
-
- that.animate = function(animate) {
- _animate = animate;
- }
-
- return that;
-})( window.jQuery );
diff --git a/public/js/bootstrap.js b/public/js/bootstrap.js
index 14943ed5..8ae571b6 100644
--- a/public/js/bootstrap.js
+++ b/public/js/bootstrap.js
@@ -1,31 +1,22 @@
-/**
-* bootstrap.js v3.0.0 by @fat and @mdo
-* Copyright 2013 Twitter Inc.
-* http://www.apache.org/licenses/LICENSE-2.0
-*/
-if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
+/*!
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
/* ========================================================================
- * Bootstrap: transition.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#transitions
+ * Bootstrap: transition.js v3.1.1
+ * http://getbootstrap.com/javascript/#transitions
* ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
@@ -34,10 +25,10 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var el = document.createElement('bootstrap')
var transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd'
- , 'MozTransition' : 'transitionend'
- , 'OTransition' : 'oTransitionEnd otransitionend'
- , 'transition' : 'transitionend'
+ 'WebkitTransition' : 'webkitTransitionEnd',
+ 'MozTransition' : 'transitionend',
+ 'OTransition' : 'oTransitionEnd otransitionend',
+ 'transition' : 'transitionend'
}
for (var name in transEndEventNames) {
@@ -45,13 +36,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return { end: transEndEventNames[name] }
}
}
+
+ return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
- var called = false, $el = this
- $(this).one('webkitTransitionEnd', function () { called = true })
- var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') }
+ var called = false, $el = this
+ $(this).one($.support.transition.end, function () { called = true })
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
@@ -60,29 +53,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.support.transition = transitionEnd()
})
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: alert.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#alerts
+ * Bootstrap: alert.js v3.1.1
+ * http://getbootstrap.com/javascript/#alerts
* ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// ALERT CLASS DEFINITION
// ======================
@@ -159,36 +142,27 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: button.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#buttons
+ * Bootstrap: button.js v3.1.1
+ * http://getbootstrap.com/javascript/#buttons
* ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, Button.DEFAULTS, options)
+ this.$element = $(element)
+ this.options = $.extend({}, Button.DEFAULTS, options)
+ this.isLoading = false
}
Button.DEFAULTS = {
@@ -208,22 +182,31 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit
- setTimeout(function () {
- state == 'loadingText' ?
- $el.addClass(d).attr(d, d) :
- $el.removeClass(d).removeAttr(d);
- }, 0)
+ setTimeout($.proxy(function () {
+ if (state == 'loadingText') {
+ this.isLoading = true
+ $el.addClass(d).attr(d, d)
+ } else if (this.isLoading) {
+ this.isLoading = false
+ $el.removeClass(d).removeAttr(d)
+ }
+ }, this), 0)
}
Button.prototype.toggle = function () {
+ var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
- var $input = this.$element.find('input').prop('checked', !this.$element.hasClass('active'))
- if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
+ var $input = this.$element.find('input')
+ if ($input.prop('type') == 'radio') {
+ if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
+ else $parent.find('.active').removeClass('active')
+ }
+ if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}
- this.$element.toggleClass('active')
+ if (changed) this.$element.toggleClass('active')
}
@@ -235,7 +218,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
- var data = $this.data('button')
+ var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
@@ -267,29 +250,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
e.preventDefault()
})
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: carousel.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#carousel
+ * Bootstrap: carousel.js v3.1.1
+ * http://getbootstrap.com/javascript/#carousel
* ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// CAROUSEL CLASS DEFINITION
// =========================
@@ -310,8 +283,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}
Carousel.DEFAULTS = {
- interval: 5000
- , pause: 'hover'
+ interval: 5000,
+ pause: 'hover',
+ wrap: true
}
Carousel.prototype.cycle = function (e) {
@@ -339,7 +313,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
if (pos > (this.$items.length - 1) || pos < 0) return
- if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
@@ -348,7 +322,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
@@ -376,27 +350,30 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var fallback = type == 'next' ? 'first' : 'last'
var that = this
- this.sliding = true
-
- isCycling && this.pause()
+ if (!$next.length) {
+ if (!this.options.wrap) return
+ $next = this.$element.find('.item')[fallback]()
+ }
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+ if ($next.hasClass('active')) return this.sliding = false
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
- if ($next.hasClass('active')) return
+ this.sliding = true
+
+ isCycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
- this.$element.one('slid', function () {
+ this.$element.one('slid.bs.carousel', function () {
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator && $nextIndicator.addClass('active')
})
}
if ($.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
@@ -406,16 +383,14 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
- setTimeout(function () { that.$element.trigger('slid') }, 0)
+ setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
- .emulateTransitionEnd(600)
+ .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
- this.$element.trigger('slid')
+ this.$element.trigger('slid.bs.carousel')
}
isCycling && this.cycle()
@@ -481,29 +456,19 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
})
})
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: collapse.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#collapse
+ * Bootstrap: collapse.js v3.1.1
+ * http://getbootstrap.com/javascript/#collapse
* ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
@@ -533,7 +498,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
- var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
+ var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) {
var hasData = actives.data('bs.collapse')
@@ -554,7 +519,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var complete = function () {
this.$element
.removeClass('collapsing')
- .addClass('in')
+ .addClass('collapse in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
@@ -622,6 +587,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
+ if (!data && options.toggle && option == 'show') option = !option
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
@@ -654,36 +620,26 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $parent = parent && $(parent)
if (!data || !data.transitioning) {
- if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
+ if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}
$target.collapse(option)
})
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: dropdown.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#dropdowns
+ * Bootstrap: dropdown.js v3.1.1
+ * http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// DROPDOWN CLASS DEFINITION
// =========================
@@ -691,7 +647,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle=dropdown]'
var Dropdown = function (element) {
- var $el = $(element).on('click.bs.dropdown', this.toggle)
+ $(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.prototype.toggle = function (e) {
@@ -705,21 +661,22 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
clearMenus()
if (!isActive) {
- if ('ontouchstart' in document.documentElement) {
- // if mobile we we use a backdrop because click events don't delegate
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+ // if mobile we use a backdrop because click events don't delegate
$('').insertAfter($(this)).on('click', clearMenus)
}
- $parent.trigger(e = $.Event('show.bs.dropdown'))
+ var relatedTarget = { relatedTarget: this }
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$parent
.toggleClass('open')
- .trigger('shown.bs.dropdown')
- }
+ .trigger('shown.bs.dropdown', relatedTarget)
- $this.focus()
+ $this.focus()
+ }
return false
}
@@ -742,7 +699,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return $this.click()
}
- var $items = $('[role=menu] li:not(.divider):visible a', $parent)
+ var desc = ' li:not(.divider):visible a'
+ var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
if (!$items.length) return
@@ -750,19 +708,20 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
- if (!~index) index=0
+ if (!~index) index = 0
$items.eq(index).focus()
}
- function clearMenus() {
+ function clearMenus(e) {
$(backdrop).remove()
- $(toggle).each(function (e) {
+ $(toggle).each(function () {
var $parent = getParent($(this))
+ var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
- $parent.trigger(e = $.Event('hide.bs.dropdown'))
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
- $parent.removeClass('open').trigger('hidden.bs.dropdown')
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
@@ -771,7 +730,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
if (!selector) {
selector = $this.attr('href')
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
var $parent = selector && $(selector)
@@ -788,9 +747,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
- var data = $this.data('dropdown')
+ var data = $this.data('bs.dropdown')
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
@@ -813,58 +772,54 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
- .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
- .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: modal.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#modals
+ * Bootstrap: modal.js v3.1.1
+ * http://getbootstrap.com/javascript/#modals
* ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
- this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
+ this.$element = $(element)
this.$backdrop =
this.isShown = null
- if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
+ if (this.options.remote) {
+ this.$element
+ .find('.modal-content')
+ .load(this.options.remote, $.proxy(function () {
+ this.$element.trigger('loaded.bs.modal')
+ }, this))
+ }
}
Modal.DEFAULTS = {
- backdrop: true
- , keyboard: true
- , show: true
+ backdrop: true,
+ keyboard: true,
+ show: true
}
- Modal.prototype.toggle = function () {
- return this[!this.isShown ? 'show' : 'hide']()
+ Modal.prototype.toggle = function (_relatedTarget) {
+ return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
}
- Modal.prototype.show = function () {
+ Modal.prototype.show = function (_relatedTarget) {
var that = this
- var e = $.Event('show.bs.modal')
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
@@ -874,6 +829,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.escape()
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
+
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
@@ -881,7 +838,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
that.$element.appendTo(document.body) // don't move modals dom position
}
- that.$element.show()
+ that.$element
+ .show()
+ .scrollTop(0)
if (transition) {
that.$element[0].offsetWidth // force reflow
@@ -893,13 +852,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
that.enforceFocus()
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
+
transition ?
- that.$element
+ that.$element.find('.modal-dialog') // wait for modal to slide in
.one($.support.transition.end, function () {
- that.$element.focus().trigger('shown.bs.modal')
+ that.$element.focus().trigger(e)
})
.emulateTransitionEnd(300) :
- that.$element.focus().trigger('shown.bs.modal')
+ that.$element.focus().trigger(e)
})
}
@@ -921,6 +882,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$element
.removeClass('in')
.attr('aria-hidden', true)
+ .off('click.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
@@ -964,7 +926,6 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}
Modal.prototype.backdrop = function (callback) {
- var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
@@ -973,7 +934,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$backdrop = $('')
.appendTo(document.body)
- this.$element.on('click', $.proxy(function (e) {
+ 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])
@@ -995,7 +956,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
- $.support.transition && this.$element.hasClass('fade')?
+ $.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
@@ -1012,15 +973,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var old = $.fn.modal
- $.fn.modal = function (option) {
+ $.fn.modal = function (option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
+ if (typeof option == 'string') data[option](_relatedTarget)
+ else if (options.show) data.show(_relatedTarget)
})
}
@@ -1043,45 +1004,35 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
- e.preventDefault()
+ if ($this.is('a')) e.preventDefault()
$target
- .modal(option)
+ .modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
- var $body = $(document.body)
- .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
- .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
+ $(document)
+ .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
+ .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
-}(window.jQuery);
+}(jQuery);
/* ========================================================================
- * Bootstrap: tooltip.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#affix
+ * Bootstrap: tooltip.js v3.1.1
+ * http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
-+function ($) { "use strict";
++function ($) {
+ 'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
@@ -1098,15 +1049,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}
Tooltip.DEFAULTS = {
- animation: true
- , placement: 'top'
- , selector: false
- , template: '