Skip to content

Commit

Permalink
Upgrade jQuery and Bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispederick committed Mar 6, 2014
1 parent e668823 commit b0e307e
Show file tree
Hide file tree
Showing 12 changed files with 6,842 additions and 7,898 deletions.
4 changes: 2 additions & 2 deletions configuration/firefox/install.rdf
Expand Up @@ -48,14 +48,14 @@
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:maxVersion>25.*</em:maxVersion>
<em:maxVersion>27.*</em:maxVersion>
<em:minVersion>3.6</em:minVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:maxVersion>2.20.*</em:maxVersion>
<em:maxVersion>2.24.*</em:maxVersion>
<em:minVersion>2.0</em:minVersion>
</Description>
</em:targetApplication>
Expand Down
23 changes: 7 additions & 16 deletions source/common/javascript/common/bootstrap/collapse.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: collapse.js v3.0.2
* Bootstrap: collapse.js v3.1.1
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* 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';

// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
Expand Down Expand Up @@ -69,7 +59,7 @@
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('in')
.addClass('collapse in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
Expand Down Expand Up @@ -137,6 +127,7 @@
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]()
})
Expand Down
53 changes: 23 additions & 30 deletions source/common/javascript/common/bootstrap/dropdown.js
@@ -1,32 +1,22 @@
/* ========================================================================
* Bootstrap: dropdown.js v3.0.2
* Bootstrap: dropdown.js v3.1.1
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* 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';

// DROPDOWN CLASS DEFINITION
// =========================

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) {
Expand All @@ -41,17 +31,18 @@

if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we we use a backdrop because click events don't delegate
// if mobile we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').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()
}
Expand All @@ -77,27 +68,29 @@
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

var index = $items.index($items.filter(':focus'))

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)
})
}

Expand All @@ -106,7 +99,7 @@

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)
Expand All @@ -123,9 +116,9 @@
$.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)
})
}
Expand All @@ -148,7 +141,7 @@
$(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)

}(jQuery);
53 changes: 25 additions & 28 deletions source/common/javascript/common/bootstrap/modal.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: modal.js v3.0.2
* Bootstrap: modal.js v3.1.1
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* 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';

// MODAL CLASS DEFINITION
// ======================
Expand All @@ -29,13 +19,19 @@
this.$backdrop =
this.isShown = null

if (this.options.remote) this.$element.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 (_relatedTarget) {
Expand All @@ -54,7 +50,7 @@

this.escape()

this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
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')
Expand All @@ -63,7 +59,9 @@
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
Expand Down Expand Up @@ -105,7 +103,7 @@
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.modal')
.off('click.dismiss.bs.modal')

$.support.transition && this.$element.hasClass('fade') ?
this.$element
Expand Down Expand Up @@ -149,7 +147,6 @@
}

Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''

if (this.isShown && this.options.backdrop) {
Expand All @@ -158,7 +155,7 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)

this.$element.on('click.dismiss.modal', $.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])
Expand All @@ -180,7 +177,7 @@
} 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) :
Expand Down Expand Up @@ -228,9 +225,9 @@
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, this)
Expand All @@ -240,7 +237,7 @@
})

$(document)
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })

}(jQuery);
35 changes: 14 additions & 21 deletions source/common/javascript/common/bootstrap/popover.js
@@ -1,24 +1,14 @@
/* ========================================================================
* Bootstrap: popover.js v3.0.2
* Bootstrap: popover.js v3.1.1
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* 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';

// POPOVER PUBLIC CLASS DEFINITION
// ===============================
Expand All @@ -29,11 +19,11 @@

if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')

Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right'
, trigger: 'click'
, content: ''
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right',
trigger: 'click',
content: '',
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})


Expand All @@ -54,7 +44,9 @@
var content = this.getContent()

$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
](content)

$tip.removeClass('fade top bottom left right in')

Expand Down Expand Up @@ -98,6 +90,7 @@
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option

if (!data && option == 'destroy') return
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
if (typeof option == 'string') data[option]()
})
Expand Down

0 comments on commit b0e307e

Please sign in to comment.